I was working on a project recently, which involved file uploading issues, so I found some information and studied it. When users need to transfer files to the server, the common method is to use FTP. Although the transmission is stable using FTP, security is a serious problem, and the FTP server reads the user library to obtain permissions, which is not convenient for users to use. So convenient. If we can integrate the file upload function with the Web so that users can complete the upload task using only a Web browser, it will be very convenient for them.
There are many ways to introduce ASP files to upload on the Internet. In summary, there are the following three categories of implementation methods. Readers can choose the appropriate method according to the conditions and needs of their own website.
1. Server component upload method:
This method is represented by SA-FileUp component, AspUpload component, and lyfUpload component.
Software Artisans' SA-FileUp is one of the earliest commercial Active Server components. It has been improved several times and now exists as a pure ASP component. Persits Software's ASPUpload is also a very powerful COM component. They all implement the functions required for various file uploads: uploading large files, limiting the size of uploaded files, uploading multiple files, displaying upload progress bars, being able to save files to the database,...
The advantages of this method are stable operation, powerful functions, and no requirements on the browser. The disadvantage is that the component needs to be registered on the server. If the website administrator has administrative rights to the server, this method should be the first choice for implementing file uploads.
2. Component-free upload method:
This method is represented by Huajing component-free upload, Wufear component-free upload, Pioneer component-free upload, etc.
This method is the most widely used method on the Internet, and there are source codes for many application examples. Its advantage is that it does not have any requirements for servers and browsers, has strong adaptability, and has a wide range of applications. But it also has a shortcoming. There is no progress bar display when uploading files, and the default limit of IIS does not allow uploading files exceeding 200KB (unless the default setting of IIS AspMaxRequestEntityAllowed is modified).
If you only need to upload small files, this should be the preferred option. If you need to upload large files, the website administrator needs to modify the default setting of IIS AspMaxRequestEntityAllowed.
3. Browser component upload method:
This method is represented by XUpload component, XUploadFiles component, and Zongheng HTTP file upload component.
This method is relatively less used on the Internet. Its advantage is that it has no requirements for the server, does not need to install components on the server, and can provide various functions required for file upload: uploading large files, limiting the size of uploaded files, uploading Multiple files, display upload progress bar,…. Its shortcomings are also obvious, requiring the browser component to be registered (on the client). This method is suitable for situations where large files need to be uploaded and the website administrator does not have administrative rights to the server (such as virtual hosting, rented space, etc.).
Server requirements, | browser requirements to | upload files, limit | whether there is a progress bar when uploading | ,other | ||
---|---|---|---|---|---|---|
SA-FileUp | installation components | - | support large files, unlimited | progress bar | , server control is required. | |
AspUpload | installation component | - | support large files, unlimited | progress bar, | need Server control right | |
lyfUpload | installation component | - | supports large files, unlimited | | to have server control right, no need | |
, no component upload | - | - | related to IIS settings, The default setting of IIS is up to 200KB | . | There is no | universal setting. Suitable for uploading small files |
without fear of uploading components | - | - | related to IIS settings. The default setting of IIS is up to 200KB | . | There is no | universal setting. Applicable to small file uploads |
and | Pioneer component-less uploads | - | related to IIS settings, The default setting of IIS is up to 200KB | . | There is no | universal setting. Suitable |
for | small | file | uploads | | And need to upload large files | |
Zongheng HTTP file upload component | - | the installation component | supports large files, unlimited | rental space | with progress bar | , And need to upload large files |