IIS7 Binary Stream Error
- by WDuffy
I'm struggling to understand the problem I'm seeing so please accept my apology if the question is vague. I'm running a classic asp app in IIS7 and everything seems to work fine except for one issue that has me stumped.
Basically, files can be downloaded from the server which is done using the sendBinary method of Persits ASP Upload component. This component works fine for uploading etc it's just the downloading I have a problem.
The strange thing is, I cannot have a pure asp page that serves the binary file. Everything works fine in II6, but in II7 there is a strange problem. For example this does not work.
<%
SET objUpload = server.createObject("Persits.Upload")
objUpload.sendBinary "D:\sites\file.pdf", true, "application/octet-binary", true
SET objUpload = NOTHING
%>
However, if I put anything in front of the asp code the file is served fine.
serve this
<%
SET objUpload = server.createObject("Persits.Upload")
objUpload.sendBinary "D:\sites\file.pdf", true, "application/octet-binary", true
SET objUpload = NOTHING
%>
I can also write something to the response stream first and it works fine.
<%
Response.Write("server this")
SET objUpload = server.createObject("Persits.Upload")
objUpload.sendBinary "D:\sites\file.pdf", true, "application/octet-binary", true
SET objUpload = NOTHING
%>
Does anyone have any ideas of what could be causing this or has anyone ran into a similar situation? I'm sure it has something to do with the setup in IIS 7.