Hello,
Many of my old ASP6 website use http upload to send pdf files (it is not https protocol but http). The files are saved to disk (not open in the browser). The code below works since many years but is not compatible with IE11 anymore. The upload seems to begin but the filename (Content-Disposition) is not used to save the file (save as). The size shown in the box (save as) is Ok (Content-length ?). The file name of the asp file with no extension is used instead of. So the upload starts and fails, the file is saved to disk with 0 byte and a wrong filename with ".partial" extension.
The content-type send in http header is not used (mime type), the filename extension is not used (Content-Disposition). If I use "application/octet-stream" instead of "application/pdf", it does not work.
The server is W2003R2sp2, IIS6.
This code works with all browser (FF, chrome, safari and all IE before new versions) :
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile FullPathPdf
Response.Clear
Response.Buffer = True
Response.AddHeader "Content-Disposition", "attachment; filename=""" & FileNamePDF & """"
Response.AddHeader "Content-length", objStream.Size
Response.AddHeader "Content-Transfer-Encoding", "binary"
Response.AddHeader "Pragma", "public"
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Cache-Control", "must-revalidate, post-check=0, pre-check=0"
Response.AddHeader "Expires", "0"
Response.ContentType = "application/pdf"
Do While Not objStream.EOS
Response.BinaryWrite objStream.Read(10240)
Response.Flush
Loop
objStream.Close
Set objStream = Nothing
Thank you.