Request doesn ' t contain a multipart/form-data or multipart/mixed stream

Source: Internet
Author: User

The Enctype property of the form is encoded and is commonly used in two ways: application/x-www-form-urlencoded and Multipart/form-data, and the default is application/ X-www-form-urlencoded.

When the action is get, the browser converts the form data into a string (Name1=value1&name2=value2 ...) using x-www-form-urlencoded encoding. , and then append the string to the URL and use the? Split to load the new URL.
When the action is post, the browser encapsulates the form data into the HTTP body and sends it to the server.

If you don't have a type=file control, you can use the default application/x-www-form-urlencoded.
But if you have type=file, you will need to use Multipart/form-data. The browser splits the entire form into controls and adds Content-disposition (form-data or file) to each section, Content-type (default is Text/plain), name (control name), and so on. and add a separator (boundary).
If you have the following form, and select the File1.txt upload
<form action= "Http://"
Enctype= "Multipart/form-data"
Method= "POST" >
<input type= "text" name= "Submit-name" value= "chmod777" ><br/>
What files are you sending? <input type= "file" name= "Files" ><br/>

It has the following body:
Content-type:multipart/form-data; boundary=aab03x

Content-disposition:form-data; Name= "Submit-name"

Content-disposition:form-data; Name= "Files"; Filename= "File1.txt"

... contents of file1.txt ...

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.