Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
559 views
in Technique[技术] by (71.8m points)

asp.net - Preventing browser timeout on large file uploads

I have a nice little file upload control I wrote for ASP.NET webforms that utilizes an IFrame and ASP.NET AJAX.

However, on large uploads, the browser times out before it can finish posting the form.

Is there a way I can increase this?

I'm not really interesting in alternative solutions, so don't suggest changing the entire thing out please. It works good for <5 meg uploads, I'd just like to get it up to about 8mb.

EDIT: Setting the timeout in Page_Load didn't appear to change anything.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to update a metabase setting on IIS6 and later. The key is " AspMaxRequestEntityAllowed" and is expressed in bytes. I highly recommend the Metabase Explorer to make the change, wading through the XML at %systemroot%system32inetservmetabase.xml is possible though.

Metabase Explorer: http://support.microsoft.com/kb/840671

Hmmm, perhaps I'm barking up the wrong tree... you wouldn't be doing 5 MB files if that wasn't already adjusted.

Another stab at it: see your web.config:

<system.web>
  <httpRuntime  maxRequestLength="10240" executionTimeout="360"/>
</system.web>

Max request length is in kilobytes and execution timeout is in seconds.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...