How to solve the problem of Asp.net.mvc uploading attachments over length?

Source: Internet
Author: User

Recently, in doing an upload attachment function, but the file is more than 4M, the uploaded file over the length of the issue

How to solve this problem? Here I find the information, to understand the problem, there are 3 ways to solve

Scenario One: Modify the value of maxRequestLength in the Web. config configuration file for your project

Scenario Two: Modify the value of maxRequestLength in the Machine.config configuration file under the installation directory of the. NET Framework

Scenario Three: Modify the upload file size limit for the IIS service

Programme one:

1, modify the Web. config file, change this maxrequestlength default value, here is changed to 10M

<configuration> <system.web>

<configuration>

Scenario Two:

1. Locate the Machine.config file in the C:/windows/microsoft.net/framework/v1.1.4322/config directory

2, find "

Programme III:

1, first to the process of the IIS service shut down, that is, the Inetinfo.exe process off.

2, found in the system directory: Windows/system32/inesrv/metabase.xml "file, find a text editor to open,

Find the Aspmaxrequestentityallowed= "204800", this is the default size of the IIS upload file, the default is 204800Byte,

That is 200KB, you can change it to the desired size.

How to solve the problem of Asp.net.mvc uploading attachments over length?

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.