473,763 Members | 3,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving Oracle BLOB

Hello,

I have Word documents stored in the Oracle database in the BLOB field
that I need to retrieve. I've found the way of doing it:

While dr.Read
sName = dr("TE_PM_ATTAC H_NAME")
bLob = dr.GetOracleLob (1)
Response.Append Header("Content-type:",
"applicatio n/force-download")
Response.Append Header("Content-Disposition", "attachment ;
filename=" & sName)
Response.Append Header("Content-Length", bLob.Length)
Response.Charse t = "UTF-8"
' write the blob data - this will begin to force the
download
Response.Binary Write(bLob.Valu e)

End While

The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)

So he can only download this document.

If it's an image file instead of word document - there are no problems.

I would appreciate any suggestions on how to deal with this.

Thank you,

Peter

Jul 25 '06 #1
11 3933
The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)
I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")

For word this should be:

"applicatio n/vnd.ms-word"

A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html

Jul 25 '06 #2
Thank you very much, Mischa, I'll try this.

Peter

"Mischa Kroon" <ww*@bloggingab out.netwrote in message
news:55******** *************** ***@news.chello .nl...
>The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Access ing BLOB data 2[1].doc)

I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")

For word this should be:

"applicatio n/vnd.ms-word"

A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html

Jul 26 '06 #3
Didn't work, unfortunately. It seems to be a problem with the local
caching, but I don't know what exactly.

Mischa Kroon wrote:
The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)

I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")

For word this should be:

"applicatio n/vnd.ms-word"

A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html
Jul 26 '06 #4
I'm thinking maybe I should add custom headers in IIS. Not sure what is
required...

Mischa Kroon wrote:
The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)

I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")

For word this should be:

"applicatio n/vnd.ms-word"

A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html
Jul 26 '06 #5

"Peter Afonin" <pv*@speakeasy. netwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
Didn't work, unfortunately. It seems to be a problem with the local
caching, but I don't know what exactly.
Are you giving the downloads distinct filenames ?
If not you might want to try this.
Jul 26 '06 #6
Is this an SSL connection? If so, and you are using IE, if the "Save
Encrypted files to disk" is disabled then IE will not be able to put a copy
of the file in "Temporary Internet Files".
--
Brad

"Software is like melted pudding..."
"Peter Afonin" wrote:
I'm thinking maybe I should add custom headers in IIS. Not sure what is
required...

Mischa Kroon wrote:
The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:
>
This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)
I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")

For word this should be:

"applicatio n/vnd.ms-word"

A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html

Jul 26 '06 #7
Hi Mischa,

How would I do this? No, I don't. I store the name of the original file
in a separate field, and then just call the row id to retrieve this
file from the BLOB field.

Peter

Mischa Kroon wrote:
"Peter Afonin" <pv*@speakeasy. netwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
Didn't work, unfortunately. It seems to be a problem with the local
caching, but I don't know what exactly.

Are you giving the downloads distinct filenames ?
If not you might want to try this.
Jul 26 '06 #8
Thank you, Brad.

No, this is just our Intranet, no SSL.

Peter

Brad Roberts wrote:
Is this an SSL connection? If so, and you are using IE, if the "Save
Encrypted files to disk" is disabled then IE will not be able to put a copy
of the file in "Temporary Internet Files".
--
Brad

"Software is like melted pudding..."
"Peter Afonin" wrote:
I'm thinking maybe I should add custom headers in IIS. Not sure what is
required...

Mischa Kroon wrote:
The only problem here is that when the customer is trying to open the
document, in most cases (but not always, which is weird) he gets
message like this:

This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
* Try a different file name.
(C:\...\Accessi ng BLOB data 2[1].doc)
>
I think the problem lies here:
Response.Append Header("Content-type:", "applicatio n/force-download")
>
For word this should be:
>
"applicatio n/vnd.ms-word"
>
A bit more information can be found here:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html
Jul 26 '06 #9

"Peter Afonin" <pv*@speakeasy. netwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
Hi Mischa,

How would I do this? No, I don't. I store the name of the original file
in a separate field, and then just call the row id to retrieve this
file from the BLOB field.

You might want to start doing this, otherwise you could use a guid or the id
of the database table:

xxx0123.doc or something.
Jul 26 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2188
by: Mohammad | last post by:
hi when i try to send a blob or Longraw value with more than 32k as parameter to stored procedure in oracle 9i, the following exception raise "ORA-01460 : Unimplemented or Unreasonable conversion requested" please help me for solving this problen.
1
1937
by: eddie wang | last post by:
Microsoft ODBC Driver 2.573 to retrieve Oracle Data, it is slow. How to tune this? Thanks. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
2042
by: asterix | last post by:
hello, I am retrieving the blob field with de following code: ---------- rs = st.executeQuery(sql); if (rs.next()){ foto = rs.getBlob(1); length = (int)foto.length(); InputStream in = foto.getBinaryStream();
11
23031
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
0
1261
by: Utilisateur1 | last post by:
Hello, I've a problem retrieving a blob column from oracle. I'm using oledbadapter to fill a dataset like that oledataadap.fill(ds,"query"); I'm also using ColumnMapping to have more friendly column headers in dataset. The Fill method send an error with no explaznation except this "the type is not managed". Has somebody ideas about to solve that ?
9
8001
by: matt | last post by:
hello, im doing my first ASP.NET app that inserts & retrieves files from Oracle (no need for a discussion on *that*!). i learned first-hand of the somewhat awkward technique for inserting binary data into an Oracle BLOB column via ADO.NET. since my files are larger than 33k, it seemed had to use this technique: http://support.microsoft.com/default.aspx?scid=kb;en-us;322796
2
7710
by: jith87 | last post by:
I m using JSP @ front end and MySql db @ back end and the connectivity thru JDBC. While retrieving a blob(MySql format) from the db back to JSP i need to convert ths to blob(Java comaptible format).. For ths i ve used getBlob() specified in the ResultSet API docs. Bt when i run i get an error as com.mysql.jdbc.Blob@152c4d9 The above gets printed for all the blobs with a diff in the no present @ the end.... How do u convert these...
0
1513
by: jparulan | last post by:
I'm trying to insert a TIF image to ORACLE database 10g using ODP.net and also tried OleDB but I was not successful. Anybody can shed a light? this.TIFFIMG = OCRdir + "\\" + (OCRxml.Name.Replace(".xml", ".tif")); FileStream fs = new FileStream(this.TIFFIMG, FileMode.Open, FileAccess.Read); Byte imageData = new Byte ; fs.Read(imageData, 0, System.Convert.ToInt32(fs.Length)); fs.Close();
0
1855
by: Hemanth | last post by:
Hi, I'm trying to select the content from a BLOB field in a oracle table. The regular select statement doesn't seem to work (Eg. select content from file_table where file_id=1). It's returning empty content. I'm using ADODB (http://phplens.com/adodb/) library to execute sql statements. Could someone please help me out on how to fetch the blob data with ADODB functions?
0
10149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9828
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8825
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2797
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.