Enctype = "multipart/form-Data" is used to upload images in a form.
Enctype = "multipart/form-Data" is set in the form label to ensure that the uploaded files are properly encoded. As follows: <form name = "userinfo" method = "Post" Action = "first_submit.php" enctype = "multipart/form-Data"> <tr> <TD Height = "30" align =" right "> upload the Business License Image: </TD> <input type = "file" name = "uploadfile" size = "34" onchange = "checkimage () "> </TD> </tr>, you must add enctype =" multipart/form-data ". <Form>
In the form, enctype = "multipart/form-Data" indicates the mime encoding of the form. By default, the encoding format is application/X-WWW-form-urlencoded and cannot be used for file upload. Only multipart/form-data can be used to completely transmit file data, perform the following operations. enctype = "multipart/form-Data" is used to upload binary data. The input values in form are passed in binary format. The input value in form is passed in binary format, so the request will not get the value. That is to say, after this code is added, the request will fail to be passed. When you add the form value to the database, the following code is used:
Smartupload su = new smartupload (); // create a new smartupload object
Su. getrequest (). getparametervalues (); returns the array value.
Su. getrequest (). getparameter (); obtain a single parameter value