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
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
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
Dynamically set the enctype for uploading files
upfileileThe person who has studied JS may try to use JS to check and control enctype type
Fm=document.getelementbyid (' Up ');if (Fm.getattribute (' enctype ')!= ' Multipart/fm-data ')
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
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= ' 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=
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
Every time we upload a form, we set the enctype attribute to multipart/form-data, the enctype attribute specifies how the form data is encoded before being sent to the server. Default
Every time we upload a form, we set the enctype attribute to
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
Why add a property to the form where the file is uploaded enctypeUpload a file in the form to add attributes Enctype= "Multipart/form-data", many people just rote know upload form to write so, know it but do not know why. So why do you add this
In HTML, the form label is used to submit the form. The form label has a enctype property.The enctype property specifies how the form data should be encoded before it is sent to the server that is, in the syntax of the form element, enctype
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 =
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
When uploading a file, the submitted form attributes need to be added enctype= "Multipart/form-data" in order to submit the file information, otherwise it will be an error. What is the role of the Enctype property? is to set the encoding for the
Use the enctype attribute to specify the encoding type used by the browser when data is sent back to the server.Below is the description:Application/X-WWW-form-urlencoded: form data is encoded as name/value pairs. This is the standard encoding
The enctype attribute of the FORM element specifies the encoding type used when the FORM data is submitted to the server. When the value of ENCTYPE is multipartform-data, it tells us that the transmitted data uses the enctype attribute of the FORM
We all know that to allow the form to submit files, you must specify enctype = multipart/form-data attribute on the form to upload files. There are many articles about enctype, so we will not explain them any more.The problem is that the MVC Html.
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.