检索Oracle BLOB [英] Retrieving Oracle BLOB

查看:58
本文介绍了检索Oracle BLOB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我在BLOB字段中的Oracle数据库中存储了Word文档
我需要检索的
。我找到了这样做的方法:


当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"

''写blob数据 - 这将开始强制

下载

Response.BinaryWrite(bLob.Value)


结束时


这里唯一的问题是,当客户试图打开

文档时,在大多数情况下(但并非总是如此,这很奇怪),他得到这样的消息:b $ b消息:


无法找到此文件。

请尝试下列办法中的一个或多个:

*检查t的拼写他的文件名。

*尝试不同的文件名。

(C:\ ... \访问BLOB数据2 [1] .doc)


所以他只能下载这个文件。


如果它是一个图像文件而不是word文档 - 没有问题。


我将不胜感激任何关于如何处理此事的建议。


谢谢,

Peter

解决方案

这里唯一的问题是,当客户试图打开


文件,在大多数情况下(但并不总是,这很奇怪)他得到

这样的消息:


这个文件不能找到。

请尝试下列办法中的一个或多个:

*检查文件名称的拼写。

*尝试不同的文件名。

(C:\ ... \访问BLOB数据2 [1] .doc)



我认为问题在于:
Response.AppendHeader(" Content-type:"," application / force-download")


换句话说这应该是:


" application / vnd.ms-word"


可在此处找到更多信息:
http://ppewww.ph.gla.ac.uk/~ flavell / ... tent-type.html


非常感谢,Mischa,我会试一试。


Peter


" Mischa Kroon" < ww*@bloggingabout.netWrote in message

news:55 ************************** @ news。 chello.nl ..


>这里唯一的问题是,当客户试图打开
文档时,大多数情况下(但并不总是,这很奇怪)他得到这样的消息:

找不到这个文件。
请尝试下列一项或多项措施:
*检查文档名称的拼写。
*尝试使用其他文件名。
(C:\ ... \访问BLOB数据2 [1] .doc)



我认为问题出在这里:

Response.AppendHeader(" Content-type:"," application / force-download")


对于这个词应该是:


" application / vnd.ms-word"


可以在这里找到更多信息:
http://ppewww.ph.gla.ac.uk/~flavell/...tent-type.html



<集团kquote>不幸的是,没有工作。这似乎是本地

缓存的问题,但我不知道到底是什么。


Mischa Kroon写道:
< blockquote class =post_quotes>


这里唯一的问题是当客户试图打开

文档时,大多数情况下(但并非总是如此) ,这很奇怪)他得到

这样的消息:


无法找到此文件。

尝试一个或多个以下内容:

*检查文件名称的拼写。

*尝试使用其他文件名。

(C:\\ \\ ... \访问BLOB数据2 [1] .doc)



我认为问题在于:

Response.AppendHeader (内容类型:,应用程序/强制下载)


换句话说,这应该是:


" ; application / vnd.ms-word"


可在此处找到更多信息:
http://ppewww.ph.gla.ac.uk/~flavell/ .. .tent-type.html


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

解决方案

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


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



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


这篇关于检索Oracle BLOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆