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
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=
Reprinted from: http://www.cnblogs.com/sunxucool/archive/2012/12/11/2813113.html1. Get is the data that is fetched from the server and post is the data sent to the server.2. Get is the URL where the parameter data queue is added to the Action
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
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
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
When uploading files, we encountered a strange problem. IE6, 7, and 8 always failed to upload files, and the server could not receive files. We all knew that we wanted form to be able to submit files, you need to specify the attribute of enctype =
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
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.