ASP.NET method for uploading files

zhaozj2021-02-16  62

How to set up the maximum upload file size? Use the text editor to open the Machine.config file under the% systemroot% / microsoft.net / framework / v1.1.4322 / config, find the section, modify the properties of this configuration section maxRequestLength, setting this property to the system upload The file size is in KB. For example: maxRequestLength = "409600", the maximum upload file size is 400m. How to make the ASPNET user get higher privileges to obtain write access to the file system? Use the text editor to open the machine.config file under% systemroot% / microsoft.net / framework / v1.1.4322 / config, find the section, set username = "system". Page settings

select file to upload:

Runat = "server" />

4. Code

Protected Void UploadButton_Click (Object Source, Eventargs E)

{

IF (Thefile.PostedFile! = NULL)

{

Thefile.postedFile.saves (getServerName (thefile.postedfile);

}

}

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

New Post(0)