Why on ajax postbacks form content-type can not be multipart/form-data?
I have a page where form's content-type is set to enctype="multipart/form-data"
. The page contains <input type="file"
tag and an button that posts(initiates upload). Both are inside of a panel that is updated via ajax. Clicking the button generates a xmlhttp request which whose content-type is application/x-www-form-urlencoded
.
Basically the enctype of the form is ignored when the upload input is inside container that is updated via ajax.
There is lots of posts saying that you can't have multipart/form-data with a开发者_StackOverflow中文版jax. Why is this?
You can create multipart POST request - see this:
XMLHttpRequest POST multipart/form-data
精彩评论