https and file downloads

J

Jay Donnell

I have a asp script that creates a text file for download. It works
perfectly under http but breaks under https. Here is the error I get
in IE when I try to download it.

Internet Explorer cannot download (the url of the page is here) from
(the
website is here).

Internet explorer was not able to open this Internet site. The
requested
site is either unavailable or cannot be found. Please try again later.

I have read other posts about this problem, but none of them helped
me. What is the trick to getting this to work?

code:

Response.Clear
'-- the filename you give it will be the one that is shown
' to the users by default when they save
Response.AddHeader "Content-Disposition", "attachment;
filename=" & objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
'-- set as binary
objStream.Type = 1
Response.CharSet = "UTF-8"
'-- load into the stream the file
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
objStream.Close
 
J

Jay Donnell

It works fine. I think it might be a problem with the way I'm setting
the headers, but I'm really not sure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top