In order to allow client users to upload files, we must provide a form in the user interface for submitting uploads File request. Since the uploaded file is a special kind of data, different from other post data, we must set a special encoding for the form
You may not be familiar with the above enctype attribute, because it is often ignored. However, if the http post request contains both regular data and file-type data, this attribute should be displayed and added, which can improve compatibility with various browsers. Next, we have to add a user to the form Fields of upload files: 件 & lt; input name = "Attachment" Type = "File" & GT;
; Input value = "Upload attachment" type = "submit" & gt;
& lt;/form & gt;
Tip: You can set the maximum value of the upload file through the upload_max_filesize in php.ini. In addition, there is a post_max_size that can also be used to set the maximum form data allowed to be uploaded. The specific meaning is the sum of various data in the form, so you can also control the maximum value of uploaded files by setting this field. However, note that the value of the latter must be greater than the former, because the former is part of the form data of the latter