HTML Form Enctype
Http://www.w3.org/TR/html401/interact/forms.html#h-17.13.1%E2%80%8D
enctype=
Content-type [CI]
This
attribute specifies the content type used to submit the form to the server if
Resolves a method that request.getparameter () gets no value when the form's enctype= "Multipart/form-data"
Url:http://blog.csdn.net/georgejin/archive/2007/07/25/1706647.aspx
Today in the original upload file page on the basis of a file to add a
Brief introductionThe Enctype property of a form is encoded in two common ways:application/x-www-form-urlencoded and multipart/form-data, which default to Application/x-www-form-urlencoded.When action is get , the browser uses x-www-form-urlencoded
We all know that to allow form to submit files, you need to specify Enctype=multipart/form-data on the form, so that you can upload files, about enctype article a lot, no longer explain.
The problem is that the html.beginform () of MVC is used to
Enctype= ' Multipart/form-data 'HTML forms provide three methods of encoding.
Application/x-www-form-urlencoded (the default)
Multipart/form-data
Text/plain
upload a file in the form to add attributes enctype=
When you use a form to transfer data, if the form adds a enctype= "Multipart/form-data" attribute, the form request is passed to another JSP or servletIt is not possible to use Request.getparameter () to get the values of individual form
Function of the enctype attribute of form labels, formenctype
Enctype is the encoding type used by the browser when data is sent back to the server. The encoding types include:
1. application/x-www-form-urlencoded
This is the default encoding type
Enctype is the encoding type used by the browser when data is sent back to the server. The encoding types are as follows. The following example shows how to use Enctype in detail: specifies the encoding type used by the browser when data is sent
The first thing to know is that the Enctype property manages the MIME encoding of the form. A total of three values are optional:1, application/x-www-form-urlencoded2, Multipart/form-data3, Text/plainWhere application/x-www-form-urlencoded is the
The form form in HTML has a key attribute enctype=application/x-www-form-urlencoded or Multipart/form-data.1, enctype="application/x-www-form-urlencoded" is the default encoding method, when the data is submitted in this way, the content of the HTTP
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.