Not. There is no content-type="..." attribute. You cannot influence the browser choice of the Content-Type header in the multipart/form-data subpage in general, with or without JavaScript.
Why does it matter? This is a bad idea for the server side of the script to do something with the Content-Type , as this is often inaccurate. image/jpeg cannot be treated differently from application/octet-stream - this is something that should not be done, not least because the browser can choose to download JPEG as application/octet-stream or something else (in particular IE usually likes to send image/pjpeg ).
If you are in control of the server and getting the right type of file upload is critical, there must be a user interface for manually selecting it. (You can use sniffing JavaScript file extensions and / or Content-Type to set the default value, but do not rely on it.)
bobince
source share