Multipart/form-data

[Updated: Jan 28, 2017, Created: Feb 28, 2016]

Web HTTP HTML 

This is another encoding type for the Html Form post submission and should be used when a file is loaded to the server.

We have to specify this as enctype attribute value.

The default value of enctype is application/x-www-form-urlencoded.

An Html Form using file upload looks like this:

<form action="/upload-service.php" method="post" enctype="multipart/form-data">
<div>
<input id="myfile" name="myfile" type="file">
<input value="Upload" type="submit">
</div>
</form>

The file content is included in the message body.