Workarounds for uploading file size limits in MVC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.