473,231 Members | 1,766 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,231 software developers and data experts.

opening bianry files from hard disk

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.

Dec 22 '05 #1
11 2040
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 22 '05 #2
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 wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
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

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

Dec 24 '05 #3
moony marouane wrote on 24 dec 2005 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:
> 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


[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.


Not compleatly, but will the above help?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 24 '05 #4

"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane wrote on 24 dec 2005 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane wrote on 22 dec 2005 in
microsoft.public.inetserver.asp.general:

> 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


[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.


Not compleatly, but will the above help?

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


Many thanks again for your reply, the code you gave me didn't work, it opens
up the pdf file in the form of text.
This one worked for me :
http://support.microsoft.com/kb/276488/en-us
Thanks again.
Moony.
Dec 26 '05 #5
I can't see the difference between both solutions, but the second worked
whereas the one you sent didn't work.
Dec 26 '05 #6
Hi again.

I have another question, what about printing files without opening them, I
have the URL of the file and I want to print it directly to printer (with
message confirmation).
Any help is too much appreciated.

Thanks in Advance.
Dec 26 '05 #7
moony marouane wrote on 26 dec 2005 in
microsoft.public.inetserver.asp.general:
Hi again.

I have another question,
[please do not start new questions on usenet with an old subject string.]
what about printing files without opening
them, I have the URL of the file and I want to print it directly to
printer (with message confirmation).
Any help is too much appreciated.


If you mean printing it on the client via a regular browser,
that is and should be impossible with an internet security level.

Further more that is not ASP-related so off topic in this NG.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 26 '05 #8
I read once that there is a function that allows this, I just can't remember
what is it.
Anyway, thanks for your help.
Dec 27 '05 #9
moony marouane wrote on 27 dec 2005 in
microsoft.public.inetserver.asp.general:
I read once that there is a function that allows this, I just can't
remember what is it.


Allows what?

This is usenet, not email, so please quote.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 27 '05 #10

"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane wrote on 27 dec 2005 in
microsoft.public.inetserver.asp.general:
I read once that there is a function that allows this, I just can't
remember what is it.


Allows what?

This is usenet, not email, so please quote.

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


as you can see I was replying to the message where you said that my question
(about printing without opening the file from ASP) is not ASP-related and
that it's off topic in this NG. My reply was that I read once that there is
a function that allows printing from asp and that I can't remember what is
this function or where I read it.
:-)
Dec 27 '05 #11
moony marouane wrote on 27 dec 2005 in
microsoft.public.inetserver.asp.general:

"Evertjan." <ex**************@interxnl.net> a écrit dans le message de
news:Xn********************@194.109.133.242...
moony marouane wrote on 27 dec 2005 in
microsoft.public.inetserver.asp.general:
> I read once that there is a function that allows this, I just can't
> remember what is it.
>


Allows what?

This is usenet, not email, so please quote.


as you can see I was replying to the message where you said that my
question (about printing without opening the file from ASP) is not
ASP-related and that it's off topic in this NG. My reply was that I
read once that there is a function that allows printing from asp and
that I can't remember what is this function or where I read it.
:-)


Not in classic ASP, because that runs only on the server,
and only sends a HTML [with headers and clientside code] to the client,
while the printing has to be done clientside.

About asp.net [not this NG's subject] I don't know.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 27 '05 #12

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

Similar topics

5
by: Ben Jeurissen | last post by:
Hello, I have to deal with the following issue in C++: Two threads are started from the main thread, both capturing images from a different firewire camera. Both threads take shots of 460800...
1
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
2
by: Giacomin Alan | last post by:
I have to do an exercise for school where in a HTML file I have to read and write some words from a txt file. the two files are in network, not in local. can someone help me? thanks a lot. ...
1
by: Nagarajan | last post by:
Hello, I am trying to open an application as a VS . NET Project . I get this error every time "Cannot create the offline cache in C:\Documents and Settings\TEMP\My Documents\Visual...
18
by: Joe Lester | last post by:
This thread was renamed. It used to be: "shared_buffers Question". The old thread kind of died out. I'm hoping to get some more direction by rephrasing the problem, along with some extra...
2
by: zacks | last post by:
I use some shareware CD/DVD burning software that has a command line interface version. This allowed me to write my own custom SDK that performs various CD/DVD burning operations from my own VB.NET...
1
by: =?Utf-8?B?U2NobWVuZ3k2OQ==?= | last post by:
Hopefully someone can help with this query. I have searched the internet and no other occurence of this problem seems to appear so I must be unique in some way... OS : XP Media Center I...
7
by: elgiei | last post by:
Good morning at all, i have to implement a server,that every n-seconds (eg. 10sec) sends to other clients,which files and directory has been deleted or modified. i build a n-tree, for each...
3
by: varunkumarid | last post by:
Hai to all, I want to know about Files Address in inside of the Hard disk... When we Click some Files,that Time how the Operating System Identitfy the Exact File Address In Hard Disk ........ ...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.