I've tried a bunch of recommendations on forcing a download in IE6 rather than determine MIME type and open in browser, yet nothing works (even though it works fine in other browsers). Here's the code I've tried

Dim BlockOf, CountOf, objFile, objStrea

BlockOf = 10000
CountOf =

' Session is setup, and a file name (Request.Form("object") has been passed
If FSO.FileExists(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object")) The
Set objFile = FSO.GetFile(CStr(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object"))

' The filename you give it will be the one that is shown to the users by default when they save
Response.ContentType = "application/asp-unknown
Response.AddHeader "content-transfer-encoding", "binary
Response.AddHeader "content-disposition", "attachment; filename=" & objFile.Name & "
Response.AddHeader "content-length", objFile.Siz

Set objStream = Server.CreateObject("ADODB.Stream"
objStream.Ope
' Set as binary
objStream.Type =
Response.CharSet = "UTF-8
Response.Flus
' Load the file into the stream
objStream.LoadFromFile(CStr(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object"))
While objFile.Size > BlockOf + CountO
CountOf = CountOf + BlockO
Response.BinaryWrite objStream.Read(BlockOf
Response.Flus
Wen

Response.BinaryWrite objStream.Read(objFile.Size - CountOf
Response.Flus
Response.En

objStream.Clos
Set objStream = Nothin
Set objFile = Nothin

In particular, the AddHeader "Content-Disposition" line that is supposed to designate the initial filename does not work regardless of what I try. All it ends up displaying to the user is the parent folder hosting the site. Then when the download starts, the file cannot be found

As I said, if I try the code above in another browser it works fine in other browsers (both Mozilla/Firebird, and Opera) and according to the RFC, this should work

Any help would be appreciated. I've tried this on a number of different IE 6 installations, with 2000 and XP, and nothing makes any difference

fh.

RE: Forced download + IE6 by anonymous

anonymous
Tue Jan 20 10:01:06 CST 2004

I'd just like to add that this is a problem if the site is forcing https. If I use regular http, this works fine. That's out of the question though.

RE: Forced download + IE6 by anonymous

anonymous
Tue Jan 20 10:41:06 CST 2004

This is the problem

' Make sure the page is not cached on the client. This breaks file downloads on IE through https
'Response.CacheControl = "no-cache
'Response.AddHeader "Pragma", "no-cache
'Response.Expires = -

I had this in the header for each of my pages. When commented out, forced download's through IE 6 over https worked fine. Now, my problem is that cached pages could be a problem. Does anyone know any other way of disabling the cache on a specific site?