http://www.w3.org/TR/html401/interact/forms.html

In particular, the section on "Form content types". For a large file (not text or more than a few tens of bytes) you typically want a Content-Type of "multipart/form-data" rather than "application/x-www-form-urlencoded" in your headers. Your request payload then needs to be encoded suitably.