从硬盘打开bianry文件 [英] opening bianry files from hard disk

查看:69
本文介绍了从硬盘打开bianry文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我正在寻找有关打开(不保存)二进制文件的代码(pdf,word,

excel ...)从asp硬盘,网站托管在C:\和pdf

文件在D:\。

有没有人对此有所了解? ?


非常感谢提前。


Moony。

Hi all

I''m looking for code regarding opening (not saving) binary files (pdf, word,
excel...) from hard disk with asp, the website is hosted in C:\ and the pdf
files are in D:\.
Does anyone have an idea about this??

Many thanks in advance.

Moony.

推荐答案

moony marouane于2005年12月22日在

microsoft.public.inetserver.asp.general写道:
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
我正在寻找有关使用asp从硬盘打开(不保存)二进制文件(pdf,
word,excel ...)的代码,网站托管在C:\
,pdf文件在D中:\。
有没有人对此有所了解?
I''m looking for code regarding opening (not saving) binary files (pdf,
word, excel...) from hard disk with asp, the website is hosted in C:\
and the pdf files are in D:\.
Does anyone have an idea about this??




二进制流

http://www.aspfaq.com/show.asp?id=2161


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)



binary stream

http://www.aspfaq.com/show.asp?id=2161

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


非常感谢你的答复Evertjan,但实际上我正在寻找代码来打开文件而不是保存它们。


为了更清楚,我有一个asp文件(托管在我的web服务器的c:\中)

列出(filesystemobjects)D:\中文件夹的内容,在这个asp文件中我

每个文件前有3个链接(下载/打印/打开),下载链接

效果不错,但不是其他2个链接。


当我使用绝对路径并尝试从另一台PC打开文件(而不是网站托管的网站服务器)时,它会尝试在

中查找它$ l $ b希望我澄清了我的问题。


再次感谢本地计算机,而不是网络服务器,因此它提供页面无法显示。





Moony


" Evertja N'QUOT。 <前************** @ interxnl.net> écritdansle message de

news:Xn ******************** @ 194.109.133.242 ...
Many thanks for your reply Evertjan, but actually I''m looking for code to
open files not to save them.

To be more clear, I have an asp file (hosted in c:\ of my web server) that
lists (filesystemobjects) the content of a folder in D:\, in this asp file I
have in front of each file 3 links (download/print/open), the download link
works great but not the 2 other links.

when I use the absolute path and try to open the files from another pc (not
the webserver where the website is hosted) it tries to look for it in the
local computer and not the webserver so it gives "page can not be displayed"

Hope I clarified my problem.

Thanks again.

Moony

"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane在2005年12月22日写道:
microsoft.public.inetserver.asp.general:
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
我正在寻找有关打开(不保存)二进制文件的代码文件(pdf,
word,excel ...)来自硬盘与asp,网站托管在C:\
和pdf文件在D:\。
是吗有没有人对此有所了解?
I''m looking for code regarding opening (not saving) binary files (pdf,
word, excel...) from hard disk with asp, the website is hosted in C:\
and the pdf files are in D:\.
Does anyone have an idea about this??



二进制流

http://www.aspfaq.com/show.asp?id=2161

-
Evertjan 。
荷兰。
(请在我的电子邮件地址中将x'变为点数)



binary stream

http://www.aspfaq.com/show.asp?id=2161

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)



moony marouane在24日写道2005年12月在

microsoft.public.inetserver.asp.general:
moony marouane wrote on 24 dec 2005 in
microsoft.public.inetserver.asp.general:
Evertjan。 <前************** @ interxnl.net> écritdansle message de
新闻:Xn ******************** @ 194.109.133.242 ...
"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane 2005年12月22日在microsoft.public.inetserver.asp.general写道:
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
>我正在寻找有关打开(不保存)二进制文件的代码
> (pdf,word,excel ...)来自asp的硬盘,网站是
>托管在C:\中,pdf文件位于D:\。
>有没有人对此有所了解?


http://www.aspfaq.com/show.asp?id=2161
> I''m looking for code regarding opening (not saving) binary files
> (pdf, word, excel...) from hard disk with asp, the website is
> hosted in C:\ and the pdf files are in D:\.
> Does anyone have an idea about this??
binary stream

http://www.aspfaq.com/show.asp?id=2161




[请不要反对usenet]

非常感谢你的回复Evertjan,但实际上我正在寻找代码
打开文件而不是保存它们。


以下示例从服务器HD获取文件,然后将其发送到

客户端,而不是必须保存。

========== main.asp ================


< a href =''myPDF.asp''>读取,不保存myPDF.pdf< / a>

===================== ===============

=========== myPDF.asp ============= =


<%

pdf(" myPDF.pdf")


函数pdf(x)

Response.Clear


strFileName =" / mySecretFolder /" &安培; x

strFilePath = server.mappath(strFilename)

''''或:strFileName =" c:\ myRootFolder \" &安培; x


设置objStream = Server.CreateObject(" ADODB.Stream")

objStream.Open


objStream.Type = 1

objStream.LoadFromFile strFilePath

Response.ContentType =" application / pdf"

Response.BinaryWrite objStream.Read

objStream.Close

设置objStream = Nothing

Response.end

结束功能

%>


================================== =====


为了更清楚,我有一个asp文件(托管在我的web服务器的c:\中)
列出(filesystemobjects)的内容在D:\中的文件夹中,在这个
asp文件中我在每个文件前面有3个链接(下载/打印/打开),下载链接工作得很好但不是其他2个链接。

当我使用绝对路径并尝试从另一台PC打开文件
(而不是托管网站的网络服务器)它试图在本地查找
它电脑而不是电脑网络服务器,所以它给页面可以
不显示

希望我澄清我的问题。



[please do not toppost on usenet]
Many thanks for your reply Evertjan, but actually I''m looking for code
to open files not to save them.
The below example gets a file from the server HD and then sends it to the
client, not neccessarily for saving.

========== main.asp ================

<a href=''myPDF.asp''>read, not save myPDF.pdf</a>
====================================
=========== myPDF.asp ==============

<%
pdf("myPDF.pdf")

function pdf(x)
Response.Clear

strFileName="/mySecretFolder/" & x
strFilePath=server.mappath(strFilename)

'''' or: strFileName="c:\myRootFolder\" & x

Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open

objStream.Type = 1
objStream.LoadFromFile strFilePath
Response.ContentType = "application/pdf"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
Response.end
end function
%>

=======================================

To be more clear, I have an asp file (hosted in c:\ of my web server)
that lists (filesystemobjects) the content of a folder in D:\, in this
asp file I have in front of each file 3 links (download/print/open),
the download link works great but not the 2 other links.

when I use the absolute path and try to open the files from another pc
(not the webserver where the website is hosted) it tries to look for
it in the local computer and not the webserver so it gives "page can
not be displayed"

Hope I clarified my problem.




不完整,但以上帮助吗?


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数。



Not compleatly, but will the above help?

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于从硬盘打开bianry文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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