473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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_ATTACH_NAME")
bLob = dr.GetOracleLob(1)
Response.AppendHeader("Content-type:",
"application/force-download")
Response.AppendHeader("Content-Disposition", "attachment;
filename=" & sName)
Response.AppendHeader("Content-Length", bLob.Length)
Response.Charset = "UTF-8"
' write the blob data - this will begin to force the
download
Response.BinaryWrite(bLob.Value)

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:\...\Accessing 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 3900
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:\...\Accessing BLOB data 2[1].doc)
I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")

For word this should be:

"application/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*@bloggingabout.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:\...\Accessing BLOB data 2[1].doc)

I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")

For word this should be:

"application/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:\...\Accessing BLOB data 2[1].doc)

I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")

For word this should be:

"application/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:\...\Accessing BLOB data 2[1].doc)

I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")

For word this should be:

"application/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*********************@i3g2000cwc.googlegrou ps.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:\...\Accessing BLOB data 2[1].doc)
I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")

For word this should be:

"application/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*********************@i3g2000cwc.googlegrou ps.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:\...\Accessing BLOB data 2[1].doc)
>
I think the problem lies here:
Response.AppendHeader("Content-type:", "application/force-download")
>
For word this should be:
>
"application/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.googlegro ups.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
Thank you, I'll try.

Peter

Mischa Kroon wrote:
"Peter Afonin" <pv*@speakeasy.netwrote in message
news:11**********************@i3g2000cwc.googlegro ups.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 27 '06 #11
This didn't work for me, but I've found the problem!

I was missing this line at the end:

Response.End()

As soon as I added it - everything started to work as expected.

Thank you for all you suggestions.

Peter

Mischa Kroon wrote:
"Peter Afonin" <pv*@speakeasy.netwrote in message
news:11**********************@i3g2000cwc.googlegro ups.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 27 '06 #12

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

Similar topics

1
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...
1
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...
2
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 =...
11
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
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...
9
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...
2
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).....
0
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 + "\\" +...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.