Upload
Recently done in the project, involving file upload problems, to find information for a moment. When the user needs to transfer files to the server, the common method is to use FTP, although the transmission is stable with FTP, but security is a serious problem, and the FTP server read user library access permissions, so that users are still not easy to use. If we can integrate the file upload function with the web, so that users can complete the upload task with only a Web browser, this will be very convenient for them.
There are many ways to introduce ASP upload file on the network, it boils down to have the following three kinds of realization method, the reader can choose the appropriate method according to the condition and the demand of own website.
One, the server component uploads the way:
This method is represented by Sa-fileup components, aspupload components, and lyfupload components.
Software Artisans's sa-fileup is one of the first commercially Active server components that has been improved and now exists as a pure ASP component. The aspupload of Persits software is also a powerful COM component. They all have the ability to upload a variety of file uploads: uploading large files, restricting the size of uploaded files, uploading multiple files, displaying upload progress bars, and being able to save files to a database 、......。
The advantage of this method is that it is stable, powerful and has no requirements for browsers. The disadvantage is that you need to register the components on the server. If the site administrator has administrative privileges on the server, the method should be the preferred way to implement file uploads.
Second, no component upload mode:
This method is represented by transformation without component uploading, without fear and without component uploading, and pioneer without component uploading.
This method is the most widely used method on the network, and there are many examples of application of the source code, the advantages of the server and browser are not any requirements, adaptability, wide range of applications. However, it also has a disadvantage that there is no progress bar displayed when uploading files, and the IIS default restrictions do not allow files exceeding 200KB to be uploaded (unless you modify the default settings for IIS aspmaxrequestentityallowed).
If you only need to upload small files, you should be the preferred option. If you need to upload a large file, you need the site administrator to modify the default settings for IIS aspmaxrequestentityallowed.
Third, browser components upload mode:
This method is represented by Xupload components, xuploadfiles components, and vertical and horizontal HTTP file upload components.
This method is relatively less applied to the network, the advantage is that there is no requirement for the server, no need to install components on the server, and can provide the various functions required for file upload: Uploading large files, restricting the size of uploaded files, uploading multiple files, displaying upload progress bars 、......。 The disadvantages are also obvious and need to register the browser component (on the client). This method applies to situations where a site administrator does not have administrative privileges on a server (such as a virtual host, leased space, and so on) that requires uploading large files.
- Various upload methods compare results horizontally:
The server requires the browser to require the upload file to limit the upload when there are no progress bar other Sa-fileup installation components-Support large files, unlimited progress bar need to have server control AspUpload install components-Support large files, unlimited progress bar need to have server control rights Lyfuplo AD Installation Components-support for large files, unlimited no need for server Control transformation No component upload-related to IIS settings,
IIS defaults to the maximum 200KB is not universal,
Suitable for small file upload without fear and no component upload--related to IIS settings,
IIS defaults to the maximum 200KB is not universal,
Suitable for small file upload pioneer non-component upload-related to IIS settings,
IIS defaults to the maximum 200KB is not universal,
Suitable for small file upload xuploadfiles-installation components support large files, unlimited progress bar rental space,
and need to upload large files
Horizontal HTTP File
Upload components-Installation components support large files, unlimited progress bar rental space,
and need to upload large files