You will find that after the form of enctype = "multipart/form-Data" is submitted, other parameters cannot be obtained using the traditional request. getparameter in the background.
I personally understand that every parameter is processed in the
This day, I wrote a jsppage table to submit the excel.xls document. At the same time, there are some HTML field variables on the page. We found that the form encoding is set to enctype = "multipart/form-data"
Request. getparameter ("? "); The value
How to obtain the form enctype attribute using JavaScript
This example describes how to use JavaScript to obtain the form enctype attribute. Share it with you for your reference. The details are as follows:
1 2 3 4 5 6 7 8 9 10 11 12
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
In many cases, for example, when multiple files are on the ship, most of us use the HTML file control. It happens that we use the master page master, and the form is on the master page, in this case, the Upload File's enctype = "multipart/form-Data"
In struts, the post method uploads files. The enctype = "multipart/form-Data" and request. getparameter ("file") are null.
In the past two days, we can see that the POST method in struts uploads files, enctype = "multipart/form-Data", request.
The examples in this article describe the way JavaScript obtains form Enctype properties. Share to everyone for your reference. Specifically as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13-14
Name: Last Name: form data would be
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
About Form enctype= "Multipart/form-data"
Recently there is a volunteer, put forward let me use PHP to do web development, have a look at PHP related syntax, it seems not too difficult, in the Win7 IIS installed use, file read and write no problem,
Property value
value
Description
application/x-www-form-urlencoded
Encode all characters before sending (default)
Multipart/form-data
Character encoding is not.You must use this value when
There are three types of enctype form
application/x-www-form-urlencoded
Encode all characters before sending (default)
Multipart/form-data
Character encoding is not.You must use this value when you use a form
The examples in this article describe the way JavaScript obtains form Enctype properties. Share to everyone for your reference. Specifically as follows:
name: last
Name:
form data would be encoded as:
The results of the operation
Recently in the background of a website, but related to the implementation of the editing function, due to the implementation of the file upload function, it is necessary to introduce enctype= "multipart/form-data" in form form, but after
About Form enctype= "Multipart/form-data"
Recently there is a volunteer, put forward let me use PHP to do web development, have a look at PHP related syntax, it seems not too difficult, in the Win7 IIS installed use, file read and write no problem,
Recently in doing a small project encounter this problem solution as follows The 1.js code below gets the current form converted to FormData Ajax submission to the background var form = $ ("#importForm"); var formData =new FormData ($scope.
Solve the problem of submitting files in product add pageDesign principlesInside the form on the JSP pageIn the background xxxservletIt is not possible to receive background form data in this wayString name = Request.getparameter (title);Why is
The HTML Form Enctype property is a MIME encoding that sets the transfer of a form, with a total of three values to choose from:
①application/x-www-form-urlencoded (default value, cannot be used for file uploads)
②multipart/form-data
Imports system. netImports system. Io
Public class httpdriverclass httpdriver
Public Function getpage () function getpage (byval URL as string, optional byref postpara as string = "", optional byref enctype as string = "gb2312") as stringReturn
This was tested and used stably. Considering uniform error handling, no catch errors were found in the class, and all network errors were captured during use to determine retry or termination. Supports get and post, custom encoding, and cookie, but
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.