Tom
Tue Aug 26 08:09:21 CDT 2003
I believe the real problem is that a PDF requires the
Acrobat reader to interpret all of thos 'ascii codes' to
display it as it should be displayed. I think Mr. Goh is
trying too hard. All he needs to do is navigate to the
PDF for the reader to be invoked as an addin to the
browser or to be downloaded to the user, if the reader is
not present as an addin. For example, as an anchor in an
HTML ...
<html>
<body>
Read a pdf file here:<a
href=
http://www.someserver.net/test.pdf>Test.PDF</a>
<body>
<html>
In any case, it definitely cannot be streamed to the user
in the manner proposed, regardless of the object(s) used
to read or write it.
Tom Lavedas
===========
>-----Original Message-----
>"Bernard Goh" <bghs312@hotmail.com> wrote in message
>news:%23MSvvl6aDHA.2580@TK2MSFTNGP12.phx.gbl...
>> I have the following code ...
>>
>>
>> Const ForReading = 1, ForWriting = 2, ForAppending = 8
>> Const TristateUseDefault = -2, TristateTrue = -1,
TristateFalse = 0
>> Dim fso, f, ts
>> Set fso = CreateObject("Scripting.FileSystemObject")
>>
>> strPhyPath = Server.MapPath
("/paysonnelCE/Misc/Bernard")
>>
>> Set f = fso.GetFile(strPhyPath & "\test.pdf")
>>
>> Set ts = f.OpenAsTextStream(ForReading,
TristateUseDefault)
>>
>> Response.Buffer = True
>> Response.ContentType = "application/pdf"
>> Response.BinaryWrite ts.ReadAll
>> Response.Flush
>>
>> the purpose is to stream a pdf to client... but all I
get is the details,
>> ascii codes of the pdf ... anyway I can get a pdf
instead of ascii text
>> display ?
>>
>The FileSystemObject is designed for text files, you may
have more luck with
>the adodb.stream class.
>--
>
>Joe
>
>
>.
>