Reputation: 1368
I have a file upload control in MVC i.e input type file.My first problem is that
If I am uploading a file,it is taking too long. I tried to upload a file of 4.2 Mb. As I was calculating the time, it automatically stops operation after 3 minutes but till then also file did'nt get uploaded.
I have this setting in my web.config file::
<httpRuntime targetFramework="4.5" maxRequestLength="10240" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
Upvotes: 0
Views: 388
Reputation: 1896
1. why it is taking too long to upload as this is a simple upload code?
There may be bandwidth limitations with your host or client. Bandwidth can be the main cause of slow upload.
If there are no issues with bandwidth then you can get some help here.
2. I want to set the application time out to maximum. How can I set it?
You can set max upload size and timeout in your webconfig as:
<system.web>
<httpRuntime maxRequestLength="10240" executionTimeout="360"/>
</system.web>
Max request length is in kilobytes and execution timeout is in seconds.
Upvotes: 2
Reputation: 3787
Add into system.web
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
</system.web>
and into system.webServer
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
Upvotes: 0