Should a HTTP POST'ed file be base64 encoded?

base64, http

Solution

No, the preferred way is using `multipart/form-data` encoding, exactly as you would use with HTML form based file uploads.

Problem

I'm currently implementing a client application that POST's a file over HTTP and have implemented base64 encoding on the file's data parameter. However, it appears that when inspecting the traffic between a simple HTML page with a file upload form and the server that no Content-Transfer-Encoding header is sent in the body when describing the file's parameter. Is this the preferred way of POST'ing a file over HTTP?

Original source