Analysis of HTTP Archives Upload Mechanism

xiaoxiao2021-03-06  39

Design website, directly providing file upload mechanisms on the webpage is a common function, such as: uploading photos, uploading personal web, etc. In this article, it is not a general FTP file upload function, but refers to the use of Multipart / Form-Data Protocol, through the HTTP Port, directly upload the files on the netizen computer to Web Server, and the web server is similar to the CGI mechanism. , Receive files and process it. Multipart / Form-Data Protocol Description: Before you perform an archive upload mechanism, let's first understand how the browser uploads the file to Web Server, first understand this mechanism, will help the program. The browser uploads the file through the HTTP to Web Server, is the definition of standard multipart / form-data, the original file is defined as follows: http://www.faqs.org/rfcs/rfc2388.html. It is a bit difficult to see the original file, because the file is based on several RFC definitions, in order to make you quick understanding, here the example will be used. When defining

, Uploaded information. ? L? F?} The last line is the content of the INPUT, and the content entered on the web page is here, so the Chinese word will become garbled. In the program, it must be encoded back to BIG5, so Chinese strings can be displayed normally. ----------------------------- 7D131A26A016A The second block begins, when analyzing the information, when you encounter Boundary, At the end of a block, the next block begins. Content-disposition: form-data; name = "m_pwd" is the information on the field on the web page. This field of netizens did not enter any information, so it is blank.

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

New Post(0)