ASPX error using response.writefile -"the server reset the connect

G

Guest

We are streaming a PDF file out of an ASPX page in IIS 5 using Response.WriteFile so the user does not need permissions to the directory where the files are stored. This works great when the user is on a fairly fast network connection or when the PDF is not too large. However, for users on slow connections that try to download a large PDF (+30meg), they receive a "the server reset the connection" error message after about 15 minutes of downloading. We tried increasing the Server.ScriptTimeout of the ASPX but without success probably because the ASPX itself executes fairly quickly, it's just the data stream download to the client that is taking so long. What is causing the timeout and can we increase it?
 
G

Guest

I think you can set timeout to be longer in the web.config. Do a google search and you should come up with something. I can't remember off the top of my head
 
S

Steven Cheng[MSFT]

Hi Chris,

From your description, you encoutnered the "Connection reset" error
sometimes when the user is downloading a file (with large size and not very
fast newwork bandwidth), yes?

Generally, such issues is likely due to the timeout setting for the IIS or
ASP.NET, as you mentioned that you've tried the Server.ScriptTimeout and
with no success, I think you can also have a look at the "executionTimeout"
attribute in the <httpRuntime> configuration element for asp.net, here is
the reference in MSDN:

#<httpRuntime> Element
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfhttpruntimesectio
n.asp?frame=true

Also, I think it's better to write the file via a buffer field rather than
directly write into the response stream by response.write file, you may
have a look at the following kb article for some reference.

#PRB: Response.WriteFile Cannot Download a Large File
http://support.microsoft.com/?id=812406

In addition, if you still have no success on this problem. I suggest that
You have a look at the IIS log or feel free to post here so that we can
also have a look to see whether it provides any clues. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
S

Steven Cheng[MSFT]

Hi Chris,

Thanks for your followup. AS you mentioned that the timeout problem still
occurs, I think you can have a try using the buffering output means
mentioned in the following kb article:

#PRB: Response.WriteFile Cannot Download a Large File
http://support.microsoft.com/?id=812406

Using a buffer to output the stream content may be more efficient when the
file size if large. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top