2

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.

WDuffy
  • 123
  • 1
  • 3

1 Answers1

2

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

  • I had the same problem and this answer fixed it. – Chris Feb 12 '14 at 09:35
  • It's not a bug, although IIS could use better diagnostics. IIS7.5 is just being strict. The HTTP protocol says that Content-Length is illegal when using Chunk Encoding: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 "Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding [e.g. chunked]..." (yes, I'm currently dealing with the same problem). – Euro Micelli Feb 10 '15 at 21:21