Reputation: 175633
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.
Upvotes: 10
Views: 45738
Reputation: 41
Sometimes it's just adding more CPU capacity to the server. I'm using Azure, and I just needed to upgrade/scale from the Basic plan to the next level. I noticed the bug, by looking at the memory usage chart, which hit 100% of usage frequently.
Upvotes: 0
Reputation: 51
Open your Web.config file, and just below the <system.web>
tag, add the following tag:
<httpRuntime
executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
enableVersionHeader="true"
/>
Now, just take a look at the maxRequestLength="4096" attribute of the <httpRuntime>
tag. As you may have realized, all you need to do is change the value to some other value of your choice (8192 for 8 Mb, 16384 for 16 Mb, 65536 for 64 Mb, and so on...).
Upvotes: 1
Reputation: 1
I solved this using PHP with HTML:
Upvotes: -7
Reputation: 16281
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%\system32\inetserv\metabase.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.
Upvotes: 11
Reputation: 12475
Place this in your web.config
<system.web>
<httpRuntime executionTimeout="360" maxRequestLength="100000" />
That enables a 360 second timeout and 100,000 Kb of upload data at a time.
If that doesn't work, run this command on your IIS server. (replace [IISWebsitename])
C:\Windows\System32\inetsrv>appcmd set config "[IISWebsitename]" -section:requestFiltering -requestLimits.maxAllowedContentLength:100000000 -commitpath:apphost
That enables 100,000,000 bytes of upload data at a time.
Upvotes: 4
Reputation:
Check the code of Velodoc XP Edition. It includes an upload streaming module, a resumable download handler and ASP.NET upload controls based on ASP.NET Ajax extensions and it is all open source.
For more information check also www.memba.com and www.velodoc.com.
Upvotes: -7
Reputation: 6068
I think you may need to adjust the MaxRequestLength
Its in the Web.config I think by default its 4megs.
The following would allow ~10 meg file:
<httpRuntime maxRequestLength="10240" />
Upvotes: 1
Reputation: 23878
In Page_Load, set Server.ScriptTimeout to a value that works for you. Measured in seconds I believe.
Upvotes: 2