Here's this article is what I have learned from the Internet. Keep the author's name. -------------------------------------------------- ----------------------------- Analysis and Research on File Upload Method in Website Ning Denlu Cai Jie Jiang Dafu (Dandong Department of Computer Science and Technology, Vocational and Technical College, Dandong 118003, China) Nnffll@163.net
Summary: In a browser / server-based application environment, upload a variety of files in your browser have always been one of the difficulties that plague user file management applications. There are three mechanisms in the Upload file in HTTP: RFC1867, PUT and WebDAV. Common implementation methods are a new type introduced in RFC1867: File and ADO Stream objects. This paper discusses the above upload method and implementation principles, and gives a specific solution. Keywords: ASP component File object
Currently, the application based on the browser / server mode is popular. When the user needs to transfer files to the server, one of the common methods is to run the FTP server and set each user's FTP default directory to the user's web home directory, so that the user can run the FTP client and upload files to specified Web directory. This requires users to know how to use the FTP client. Therefore, this solution is only possible to familiarize with FTP and experienced users. If we can integrate file upload features with Web, users can use web browsers to complete upload tasks, which will be very convenient for them. However, since the file system object can only transfer the limitations of the text file, the biggest problem with the ASP is the file upload problem. The following describes how to upload the file in a web page based on HTTP protocol. One. Three mechanisms uploaded by HTTP have three mechanisms by HTTP: RFC1867, PUT and WebDAV. PUT is introduced in HTTP 1.1 into a new HTTP verb. When the web server receives an HTTP PUT and an object name, it will verify the user, receive the contents of the HTTP stream, and store it directly into the web server. Since this may cause damage to a Web site, and will lose HTTP's largest advantage: server programmability. In the case of PUT, the server handles the request: no space allows the CGI or ASP application to intervene. The only way to capture the PUT for your application is to operate at a low-level operation, the ISAPI filter layer. PUT's application is limited due to corresponding reasons. WebDAV allows distributed certification and translation of Web content. It introduces several new HTTP verbs that allow for Upload, lock / unlock, register / test the web content via HTTP. "Save to Web" in Office 2000 is implemented by WebDAV. If everything you are interested is uploaded, WebDAV is very good, it solves a lot of problems. However, if you need to upload files in your web application, WebDAV is useless to you. Like HTTP PUT, those WebDAV verbs are interpreted by the server, not a web application. You need to work in the ISAPI filter layer to access these verbs of WebDAV and explain the content in your application. RFC1867 (http://www.ietf.org/rfc/rfc1867.txt) was eventually accepted by W3C in HTML3.2, as a recommendation standard. It is a very simple but powerful idea: define a new type in the form field. and in the form itself adds different coding schemes, no longer uses typical: