Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

This is a known issue with IIS7.5 (windows 2008). They now have "chunked encoding" on my default, and you can no longer send the "content-length" header.

Persits aspupload sets it when you pass "true" for the second parameter.

I'm not sure why MSFT hasn't fixed this bug.

You can find a workaround at: http://support.persits.com/show.asp?code=PS100721176

share|improve this answer
    
I had the same problem and this answer fixed it. –  Chris Feb 12 at 9:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.