How to use VB.NET to use VB.NET in ASP.NET

xiaoxiao2021-03-05  23

The content here is basically coming from an article in MSDN, the title is ""

How to upload a file to a web server in asp.net by using Visual Basic .NET

"If there is no problem in English, Redirect is good. IIS 6.0 using Windows2003 is limited to the size of the file upload, which makes the server more secure. The default ASP upload size is 200K, and the ASP.NET has a size of 4m. There are many articles on the Internet how to break through the IIS 6.0 uploading article restrictions, in fact, file uploading for the ASP page, and how to do in the .NET environment, I used Google to search for an afternoon, I didn't find a Chinese, Wanner helpless, see English, I have to search English on my neck, I finally found a comparative standard answer on Microsoft's MSDN. Dare to enjoy exclusive, dedicated to friends who are in English as I am.

By default, ASP.NET allows upload to the web server to be less than or equal to 4096K, that is, 4M, if the uploaded file is greater than the set value, then you will see "I can't find the server or DNS" in the browser page. Error information such as it will make you confused, huh, huh. If you want to upload a bigger file, you must modify the value of the section maxRequestLength parameter in the web.config file. If you use VS.Net to create a new project, you don't have the section in the web.config file created by vs.net, you can add it. Note that you want to pack inside the section.

Such as:

This way to upload can be less than or equal to 400m. After the file is modified, you can take effect immediately without having to restart IIS.

Sometimes, we hope that the entire server can be loaded uploaded, so you can modify the value of the section maxRequestLength attribute in the machine.config file. It is important to note that the location of this file is not under the root of the web service, but in / system directory / microsoft .NET / Framework / version number / config directory (the crude object is set according to the specific environment). For example, in my environment should be: c: /windows/microsoft.net/framework/v1.1.4322/config. It is also set up immediately, and does not need to restart IIS.

The value in web.config can override the settings in Machine.config.

Because the ASP.NET first reads the entire file into the memory, then write the disk, so the uploaded file will make the server overwhelmed.

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

New Post(0)