I'm wondering if anyone else has had this problem...
I've been using this script for a while without issues for forcing a Open/Save dialog in IE & FF:
Code:
ContentType = "application/x-msdownload"
Response.Buffer = True
Const adTypeBinary = 1
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
Now I've been working on a new project and I'm running into problems using this script. The old project generated unique filenames based using vaiartions of Now() and the filenames contained no spaces.
The new project needs to push the literal name of the file which may or may not contain spaces. IE handles this fine but FF truncates the file name at the first space and displays an unknown file type.
I've resorted to the following, eventhough it goes against my better judgement to rely on "HTTP_USER_AGENT":
Code:
If InStrRev(Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") > 0 Then
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Else
Response.AddHeader "Content-Disposition", "attachment; filename=" & Replace(strFileName, " ", "")
End If
Any help is greatly appreciated. As always, thanks in advance...