Click to See Complete Forum and Search --> : [RESOLVED] HTTP Downloads in IE7


so_is_this
12-20-2006, 09:35 AM
I'm using the following code to perform an HTTP download of zipped files from a hidden folder and using hidden file names (thus, I can't just use a simple hyperlink):
<%
Response.Buffer = True
Response.Cookies("Offerings")("Tracker") = Chr2Hex(OfferingsTracker)
Response.Cookies("Offerings").Expires = DateAdd("yyyy", 10, Date())
Response.Cookies("Offerings").Path = "/"
Response.AddHeader "content-disposition", "attachment; filename=" & fileName
Response.AddHeader "content-length", Len(stream)
Response.ContentType = mimeType
Response.BinaryWrite stream
%>
Note that the MIME type I am using is the normal association for zip and tar files:

"application/x-tar"

The hyperlink I use is built from a database like this:

<a href="offering_downloader.asp?offeringno=<%=myRst.Fields("OfferingNumber").Value%>"
style="font:12pt 'Courier New',monospace;"><%=myRst.Fields("OfferingName").Value%></a>
This works perfectly in IE6, but ends up downloading only half the number of bytes when used with IE7. Any ideas as to why?

russell
12-20-2006, 10:28 AM
strange. since it is server-side code. anyway, is this the problem?

Response.AddHeader "content-length", LenB(stream)

so_is_this
12-20-2006, 10:44 AM
Yes, perhaps IE6 ignored the content-length header and IE7 is honoring it.
I'll try that this evening. Thanks for the tip.

so_is_this
12-21-2006, 04:19 PM
Working fine, now. Thanks, again.

russell
12-21-2006, 05:33 PM
sweet. so that was it? ie7 respecting byte length while ie6 does not? out of curiosity, tested that behavior in any other browsers?

so_is_this
12-21-2006, 06:04 PM
No, but I did have some others report to me that downloading using some other browsers were exhibiting the same symptom as using IE7.