Questions tagged [multipartform-data]

multipart/form-data is a content type used to send forms to web services, including file uploads.

multipart/form-data is a used to send the content of a , including , to using requests. It belongs to the family of . So it consists of several parts, each with its own and delimited using a (usually randomly generated) boundary string. The boundary string is given as a parameter to the content type of the whole document, as specified in the HTTP header. The field names are specified using the header of each part.

The multipart/form-data type is specified in RFC 2388.

multipart/form-data provides a more powerful alternative to the application/x-www-form-urlencoded type which will by default be used to submit form data in the body of a POST request. It adds the ability to transfer files, submit file names and content types for each of these, and also allows for different form fields to use different encodings. The added versatility comes at the cost of more overhead to process and transmit these messages, and in the early days a lack of interoperability with systems not supporting the method. As the method is only used if the form explicitly asks for it, the latter is of little practical concern except for those writing such forms.

4677 questions
1848
votes
9 answers

What does enctype='multipart/form-data' mean?

What does enctype='multipart/form-data' mean in an HTML form and when should we use it?
EBAG
  • 21,625
  • 14
  • 59
  • 93
862
votes
2 answers

How to send multipart/form-data request using Postman

I am currently using the Chrome Addon Postman - REST Client to easily create POST / GET request. Now I want to debug an upload script and I am looking for a way to make requests encoded as "multipart/form-data" so that I can send also a file.
Valentin Despa
  • 40,712
  • 18
  • 80
  • 106
727
votes
5 answers

How does HTTP file upload work?

When I submit a simple form like this with a file attached:
Choose a file…
0xSina
  • 20,973
  • 34
  • 136
  • 253
627
votes
13 answers

Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with $('#fileinput').attr('files') but how is it possible to send this Data to the server? The resulting array ($_POST) on…
zoku
  • 7,056
  • 3
  • 20
  • 27
567
votes
8 answers

How to send FormData objects with Ajax-requests in jQuery?

The XMLHttpRequest Level 2 standard (still a working draft) defines the FormData interface. This interface enables appending File objects to XHR-requests (Ajax-requests). Btw, this is a new feature - in the past, the "hidden-iframe-trick" was used…
Šime Vidas
  • 182,163
  • 62
  • 281
  • 385
369
votes
14 answers

How to send a "multipart/form-data" with requests in python?

How to send a multipart/form-data with requests in python? How to send a file, I understand, but how to send the form data by this method can not understand.
agrynchuk
  • 4,597
  • 3
  • 17
  • 17
260
votes
28 answers

Convert JS Object to form data

How can I can convert my JS Object to FormData? The reason why I want to do this is, I have an object that I constructed out of the ~100 form field values. var item = { description: 'Some Item', price : '0.00', srate : '0.00', color :…
Kamran Ahmed
  • 11,809
  • 23
  • 69
  • 101
197
votes
10 answers

C# HttpClient 4.5 multipart/form-data upload

Does anyone know how to use the HttpClient in .Net 4.5 with multipart/form-data upload? I couldn't find any examples on the internet.
ident
  • 3,885
  • 3
  • 14
  • 8
145
votes
3 answers

Example of multipart/form-data

I am wondering if anyone can share with me an example of multipart/form-data that contains: Some form parameters Multiple files
user496949
  • 83,087
  • 147
  • 309
  • 426
128
votes
16 answers

How to upload file to server with HTTP POST multipart/form-data?

I am developing Windows Phone 8 app. I want to upload SQLite database via PHP web service using HTTP POST request with MIME type multipart/form-data & a string data called "userid=SOME_ID". I don't want to use 3rd party libs like HttpClient,…
Farhan Ghumra
  • 15,180
  • 6
  • 50
  • 115
103
votes
3 answers

How do I set multipart in axios with react?

When I curl something, it works fine: curl -L -i -H 'x-device-id: abc' -F "url=http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" http://example.com/upload How do I get this to work right with axios? I'm using react if that matters: uploadURL…
Shamoon
  • 41,293
  • 91
  • 306
  • 570
91
votes
6 answers

Uploading file using POST request in Node.js

I have problem uploading file using POST request in Node.js. I have to use request module to accomplish that (no external npms). Server needs it to be multipart request with the file field containing file's data. What seems to be easy it's pretty…
Łukasz Jagodziński
  • 3,009
  • 2
  • 25
  • 33
87
votes
10 answers

Upload a file to Amazon S3 with NodeJS

I ran into a problem while trying to upload a file to my S3 bucket. Everything works except that my file paramters do not seem appropriate. I am using Amazon S3 sdk to upload from nodejs to s3. These are my routes settings: var multiparty =…
Maximus S
  • 10,759
  • 19
  • 75
  • 154
83
votes
7 answers

How to use FormData in node.js without Browser?

I want to make a post request in nodejs without browser since it is backend code. const formdata = new FormData() formdata.append('chartfile', file); But above code gives me error as FormData not defined. I am working with ES6. Anybody, who can let…
Josh Thomas
  • 1,607
  • 2
  • 8
  • 22
82
votes
3 answers

Apache HttpClient making multipart form post

I'm pretty green to HttpClient and I'm finding the lack of (and or blatantly incorrect) documentation extremely frustrating. I'm trying to implement the following post (listed below) with Apache Http Client, but have no idea how to actually do it. …
Russ
  • 1,996
  • 3
  • 19
  • 31
1
2 3
99 100