Response.TransmitFile Response.WriteFile SSL HTTPS

R

Ryan Pedersen

I have been trying to figure out how to transmit a file back to a user using the response.transmitfile or response.writefile method and just not having much success.

I have a dell server running windows 2003 web server edition fully patched. The files are physically on the same web server. The entire site is HTTPS... it has to be because it is a financial site.

With SSL on I cannot get TransmitFile or WriteFile to work (all files are less than 1 MB). The save box comes up just fine but when I click save... nothing happens.

If I turn off SSL TransmitFile doesn't work. But I can use WriteFile in this configuration and it does work.

Please... any suggestions that you have I am open to all of them.

Best regards,
Ryan





--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
 
D

Daniel Fisher\(lennybacon\)

You should not use the built in method for such big downloads. Use

Context.Response.Buffer=false;
FileStream inStr = null;
byte[] buffer = new byte[1024];
long byteCount;

inStr = File.OpenRead(filePath);
while ((byteCount = inStr.Read(buffer, 0, buffer.Length)) > 0)
{
if(Context.Response.IsClientConnected)
{
Context.Response.OutputStream.Write(buffer, 0, buffer.Length);
Context.Response.Flush();
}
}

instead and sent the file bitwise.
 

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,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top