BinaryWrite Files over SSL

G

Guest

Help, please. I have just spent an entire day troubleshooting a problem that
just makes me want to throw myself through my monitor.
I have the following code in asp.net:
<%@ Page language="c#"%>
<%
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment; filename=test.bin");
Response.ContentType = "text/plain";
Response.BinaryWrite(new byte[100]);
Response.End();
%>
No matter what i try, this does not work over SSL. It works over http but
not https.
My broswer is MSIE 6.0
 
S

Sylvain Lafontaine

Maybe a problem with one of the cache. Instead of ClearHeaders(), you
should try to set off the various caches. See
http://ca.php.net/manual/en/function.session-cache-limiter.php for some of
the headers that you can try to set in PHP. (Sorry, but I didn't have time
to make a search for examples in ASP or ASP.NET.)

You can also try to set the content-type to application/octet-stream instead
of text/plain and set the Content-Length to the length of your file.

Finally, I'm not sure about the net effect of mixing Response.AddHeader()
with direct call to property, like Response.ContentType = "..."; as IE is
very sensible when it comes to SSL.

S. L.
 
Joined
May 21, 2010
Messages
1
Reaction score
0
Hi All,

I have the same problem too! Over http all is well and the browser prompts to save 'filename.csv' file - HOWEVER over https the user is prompted to save 'default.aspx'. The code is simple:


response.AddHeader("Content-Disposition", "attachment;filename=Data.csv")
response.ContentType = "application/octet-stream"
Dim Encoding As New System.Text.ASCIIEncoding
response.AddHeader("Content-Length", Encoding.GetByteCount(exportContent).ToString())
response.BinaryWrite(Encoding.GetBytes(exportContent))
response.Charset = "iso-8859-2"
response.End()

I can see lots of people are having similar problems, but no resolution yet???


Col.
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top