~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chirag Shah" <chiragiit@y...>
Subject: [asp_databases] Reading a binary file
: I have PDF files in a directory that do not havs read permission. Is there
: any way I can read this pdf files and stream it out..
:
: (2) using ADO Stream Object
: Dim objStream : Set objStream = Server.CreateObject("ADODB.Stream")
:
: 'Open a PDF file
: objStream.Type = 1
: objStream.Open
: objStream.LoadFromFile "D:\webs\eas110\webroot\data\pdffiles" &
: Request.QueryString("filename")
:
: 'Output the contents of the stream object
: Response.ContentType = "application/pdf"
: Response.BinaryWrite objStream.Read
:
: 'Clean up....
: objStream.Close : Set objStream = Nothing
:
: This gives an error files could not be opened.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you say "no read permissions" is this in the IIS MMC? or no NTFS read
permissions?
The correct combo should be "no read permissions in the IIS MMC", but the
IUSR_<machinename> account still needs NTFS RW (read/write) permissions to
the folder in question for the ADO strream object to be able to read the
file off the disk.
Cheers
Ken