Configure the limit upload file size and time in the Web. config file.
You need to set the file upload limit of two attribute values in the configuration file:Maxallowedcontentlength,maxrequestlength allows the length of the uploaded file, and the length of the request, two sizes need to be set consistent, if not consistent, the request length whichever.
maxRequestLength property: Used to prevent server attacks, such as denial of access caused by a user sending large files to the server. Default value is 4096 (4MB)
Executiontimeout Property: Specifies the maximum number of seconds that a request is allowed to execute before an ASP. NET application shuts down automatically. This time-out property is only applicable if the Debug property in the compilation element is false. The default value is 110s.
<system.web>
maxRequestLength= "2147483647" executiontimeout= "36000"/>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<!--<requestlimits maxallowedcontentlength= "1073741824"/>-->
<requestlimits maxallowedcontentlength= "2147483648"/>
</requestFiltering>
</security>
</system.webServer>
Workarounds for uploading file size limits in MVC