.NET inside an accessory upload size limit control

xiaoxiao2021-03-06  80

First, the default allows uploading 4M files.

Modify the Machine.config file to change the value of the MaxRequestLength parameter. Search the file in the C: /Winnt/Microsoft.net directory.

It should be noted that when saving the file, you should make sure that the full path to the specified file (for example, "c: /myfiles/picture.jpg) and make sure the account used by the ASP.NET provides the directory to store the file. Permission. When uploading a large file, you can use the maxRequestLength attribute of the element to increase the maximum allowable value of the file size, for example:

Where: maxRequestLength: Indicates the maximum number of bytes uploaded by the HTTP mode supported by ASP.NET. This limitation can be used to prevent denial of service attacks caused by users from passing a large number of files to the server. The specified size is in KB. The default is 4096 KB (4 MB). ExecutionTIMEOUT: The maximum number of seconds allowing the request is allowed before being automatically turned off by ASP.NET. In the case where the file is exceeded, if the DNS error is generated or the service is not available, please modify the above configuration, increase the configuration number.

Second, another problem

In addition, when uploading large files, you may also receive the following error message:

ASPNET_WP.EXE (PID: 1520) is reclaimed because the memory consumption exceeds 460 MB (can be used by 60% of RAM).

If you encounter this error message, add the value of the MemoryLimit property in the element of the web.config file of the application. E.g:

If it is Windows Server2003:

Upload large files under Windows Server 2003:

When you upload a large attachment for Windows Server 2003, the system is reported: 1. First closes the IIS Admin Service service in the service 2. Find the multabase.xml under Windows / System32 / IneTsrv / under, open, find AspMaxRequestentityAllowed to modify him to need The value, the default is 204800, that is, 200K, modified it to 51200000 or more [determined according to the file size]. 3. Restart the IIS Admin Service service.

转载请注明原文地址:https://www.9cbs.com/read-122043.html

New Post(0)