I'm confused. What do you mean you can't use response.redirect?
Why not? And how is it that user's don't have access to the PDF files?
You should be able to just redirect to a PDF file. Unless what you are
saying is that those files are accessible via a web address. In that case,
you would have to open the PDF file as a file system object, then create a
HTML stream with a header indicating the document type (PDF, like you did
already) then response.write out the whole PDF file from the file system
object. That way users could access the PDF documents through a single page
with a URL of something like "getpdffile.asp?filename=somefile.pdf".
Seems like a lot of work when you could just put the PDFs in a web shared
From: Martin Bachorik [mailto:bachorikm@a...]
Sent: Saturday, March 10, 2001 11:24 AM
To: How To
Subject: RE: Reading PDF file
Peter, I forgot to specifiy:
I can't use response.redirect, users doesn't have access to these files :-(
I have to find really something from server side ... but not download the
> By using Server.Transfer, you are telling the server to process the .pdf
> file as a script (transferring execution). It would probably be safer
> more correct to use a Redirect for that. Seeing as how there probably
> much VBScript to process in a PDF file. ;-)
> -----Original Message-----
> From: Martin Bachorik [mailto:bachorikm@a...]
> Sent: Friday, March 09, 2001 9:31 AM
> To: How To
> Subject: Reading PDF file
> Response.ContentType = "application/pdf"
> Server.Transfer "pdf-file.pdf"
> is working nice, but only for PDF's not containing "<%" that type of
> characters...then you'll get error:
> Active Server Pages, ASP 0116 (0x80004005)
> The Script block lacks the close of script tag (%>).
> Some ideas?