View Single Post
Old 03-03-2013, 03:27 AM   PM User | #6
elitis
Regular Coder

 
Join Date: Sep 2010
Posts: 319
Thanks: 9
Thanked 6 Times in 6 Posts
elitis is an unknown quantity at this point
Quote:
Originally Posted by devnull69 View Post
The answer is quite easy ... and quite devastating. You cannot send the content of an input element of type="file" using jQuery Ajax methods.

Possible solutions:
- Use regular form submit
- Check the File API together with XMLHttpRequest level 2 (both not supported by all browsers yet)
- Flash fallback solutions (e.g. uploadify)
Actually the only browsers that don't support the File API are IE9, Safari 5.x, Opera 10.x, and Firefox 3.x. I.e all old browser versions. As for XHR2 support (file uploading in this case), only IE9, and Opera 11.x and below don't support it. So pretty good support.

And yeah the FormData object would be the OP's best bet.
__________________
Coding is a challenge, get used to it
Always remember to debug
Try the guess & check method
Break it down into simple steps
elitis is offline   Reply With Quote