Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BinaryWrite -- works on one server and not the other

Status
Not open for further replies.

jpeyer

Technical User
Sep 12, 2002
8
US
I have some code that boils down to this:

strFileName = "D:\pdf\original_docs\1234.pdf"
Response.ContentType = "application/pdf"
set objBinaryFile = Server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite objBinaryFile.GetFileBytes(CStr(strFileName))
set objBinaryFile = nothing

It works GREAT as expected on one server... but we are migrating over to a new server and it is a no-go. (both servers are same version of IIS [5], same service packs, etc. -- but SOMETHING is obviously different)

File paths are correct, so other than that, what could be preventing this from working?

Thanks,
Jeremy
 
Oh yeah, I'm getting a generic 500

Jeremy
 
In the browser click Tools, Internet Options, Advanced tab, scroll down slightly and deselect 'Show Friendly HTTP Error Messages'
Run the page again and see what the real error is. First guess is permissions, does the IUSR account have read permissions on the folder?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top