Enctype = "multipart/form-Data" is used to upload files in a form.
<Form name = "userinfo" method = "Post" Action = "first_submit.jsp" enctype = "multipart/form-Data">
Enctype = "multipart/form-Data" is set in the form label to ensure that the uploaded files are properly encoded.
As follows:
<Tr>
<TD Height = "30" align = "right"> browse and add upload files: </TD>
<TD> <input type = "file" name = "uploadfile" size = "34" onchange = "checkimage ()"> </TD>
</Tr>
Add enctype = "multipart/form-data ".
In the form, enctype = "multipart/form-Data" indicates the mime encoding of the form. Mo
This encoding format is application/X-WWW-form-urlencoded and cannot be used for file upload. Only multipart is used.
/Form-data can complete the transfer of 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.
Therefore, the request will not get the value. That is to say, this section is addedCode, The request will fail to be passed. When the form value is added to the database, the following 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