Solution to IIS7 large file upload restrictions in Windows

Source: Internet
Author: User

If you are using windows iis, you may find that uploading large files cannot be uploaded. Baidu later found that iis7 restricts the size of the uploaded files. We only need to modify the web. maxRequestLength in config.

In IIS7, even if you are on the web. config sets maxRequestLength = "1048576" to the maximum size that can be uploaded. In fact, it is affected by C:/Windows/System32/inetsrv/config/applicationHost. by default, only 30 mb files can be uploaded. You can modify this file. add in webServer/security/requestFiltering/Section

<RequestLimits maxAllowedContentLength = "<length>"/>

Modify <length> to the allowed size. Note that the unit here is bytes, and the unit of maxRequestLength in web. config is KB.

The procedure is as follows:

The target is to modify the file C:/Windows/System32/inetsrv/config/schema/IIS_schema.xml. The red underline indicates the target location to be modified.

The Code is as follows: Copy code

<Element name = "requestLimits">

<Attribute name = "maxAllowedContentLength" type = "uint" defaultValue = "30000000"/>

<Attribute name = "maxUrl" type = "uint" defaultValue = "4096"/>

<Attribute name = "maxQueryString" type = "uint" defaultValue = "2048"/>

<Element name = "headerLimits">

<Collection addElement = "add" clearElement = "clear" removeElement = "remove">

<Attribute name = "header" type = "string" required = "true" isUniqueKey = "true" validationType = "nonEmptyString"/>

<Attribute name = "sizeLimit" type = "uint" required = "true"/>

</Collection>

</Element>

The problem is that the file is read-only, that is, the Administrator permission cannot be modified. You must first modify the File Permission and then remove the read-only attribute.

1. Right-click a file and choose Properties> Security. Select the target user and click Advanced to modify the file owner;

2. Click "edit" to modify the permissions of the current user and add the "write" permission. Now, the permission settings are OK.

3. Remove the read-only attribute of the file.

4. Open VS as an administrator, edit the target XML file in VS, and modify the desired location.

After modification, restart IIS.

Related Article

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.