Is there a way to do the following solution in Internet Explorer? (IE7 and up)
link: Sending multipart/formdata with jQuery.ajax
The solution code works great in every browser but IE.
Is there a way to do the following solution in Internet Explorer? (IE7 and up)
link: Sending multipart/formdata with jQuery.ajax
The solution code works great in every browser but IE.
No, you can't use
jQuery.ajax
to upload files andFormData
isn't supported by IE unfortunately.Check out the Uploadify jQuery plugin to upload files via ajax. You can also use jQuery Form Plugin to upload files via ajax.
I too have faced this problem ,it may be useful to some one in need . FormData is supported only from IE10 onwards here's a link.Error because you cannot bind input fields in old browsers, like in a modern ones using FormData. You cannot upload files through AJAX in IE.Their are two alternative ways to do
Use some plugin like Uploadify jQuery plugin to upload files via
ajax. You can also use jQuery Form Plugin to
multi and uploadify
Other way is you may use iframe.
Here's is the code
Try to set forms' attributes like this:
or rather try to find ready-made jquery upload plugin
Unfortunately, IE doesn't support the
FormData
API yet. However, you can achieve something similar using any number of jQuery AJAX form post plugins, such as this one.