Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Retrieving Oracle BLOB

Reply
Thread Tools

Retrieving Oracle BLOB

 
 
Peter Afonin
Guest
Posts: n/a
 
      07-25-2006
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

 
Reply With Quote
 
 
 
 
Mischa Kroon
Guest
Posts: n/a
 
      07-25-2006
> 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



 
Reply With Quote
 
 
 
 
Peter Afonin
Guest
Posts: n/a
 
      07-26-2006
Thank you very much, Mischa, I'll try this.

Peter

"Mischa Kroon" <(E-Mail Removed)> wrote in message
news:55a53$44c6a281$3ec3ac38$(E-Mail Removed).. .
>> 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
>
>
>



 
Reply With Quote
 
Peter Afonin
Guest
Posts: n/a
 
      07-26-2006
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


 
Reply With Quote
 
Peter Afonin
Guest
Posts: n/a
 
      07-26-2006
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


 
Reply With Quote
 
Mischa Kroon
Guest
Posts: n/a
 
      07-26-2006

"Peter Afonin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.


 
Reply With Quote
 
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
Posts: n/a
 
      07-26-2006
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

>
>

 
Reply With Quote
 
Peter Afonin
Guest
Posts: n/a
 
      07-26-2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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.


 
Reply With Quote
 
Peter Afonin
Guest
Posts: n/a
 
      07-26-2006
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

> >
> >


 
Reply With Quote
 
Mischa Kroon
Guest
Posts: n/a
 
      07-26-2006

"Peter Afonin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieving BLOB from Oracle matt@mailinator.com ASP .Net 9 12-06-2006 03:37 PM
Question about blob retrieving and jsp... gbattine Java 9 06-29-2006 05:18 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Retrieving BLOB Datatype from SQL Server 2000 nkunapa Java 4 08-10-2005 04:12 PM
.NET and Oracle BLOB Robert Vabo ASP .Net 1 08-27-2003 08:11 PM



Advertisments