. NET Upload file size configuration

Source: Internet
Author: User

1. Causes

Today, colleagues in the uploading of files, found that has been unsuccessful, said the file is relatively large. Listen to understand, must be the upload file size problem ah. Then view the Web. config file and discover the size limit for setting up file uploads. Configuration file upload size, divided into 2 parts.

"1073741824"   executiontimeout= " 3600" usefullyqualifiedredirecturl="true" requestvalidationmode="  2.0" />
2. Web. config level settings

The maxRequestLength setting here is the. NET level setting, in kilobytes

"1073741824"   executiontimeout= " 3600" usefullyqualifiedredirecturl="true" requestvalidationmode="  2.0" />
3. IIS Server-level settings

There are 2 ways of doing this:

1) IIS Manager-side settings to find your own web site. The prerequisite is that when IIS is installed, there are installation request filtering, such as. Then select request filtering, edit the feature settings, change the maximum allowable content length to the desired size, and note that the units are bytes. When this is determined, IIS automatically adds a piece of code to the Web. config. This is also the 2nd way to describe the following.

2) Add the configuration in the system.webserver in Web. config. Note that the units are bytes.

    <security>            <requestFiltering>                <requestlimits maxallowedcontentlength="  8703144" />            </requestFiltering>        </security>

Reference Documentation:

Https://stackoverflow.com/questions/6327452/which-gets-priority-maxrequestlength-or-maxallowedcontentlength

https://forums.asp.net/t/1965933.aspx?increase+upload+limit+system+webServer+security+requestFiltering+ requestlimits+maxallowedcontentlength+10485760+requestfiltering+security+system+webserver+

  

. NET Upload file size configuration

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.