2

Is there any way uploading an image by post ajax request? Im using post form, but I need to handle response.

vicky
  • 1,046
  • 2
  • 12
  • 25
  • I don't think file upload through ajax are possible. You could use and `iframe` to get rid of the page refresh: http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html – Cyclonecode May 11 '13 at 09:53
  • 5
    http://stackoverflow.com/questions/9479805/how-to-upload-image-using-ajax – kuncajs May 11 '13 at 09:54
  • I think you don't need uploading image by ajax. I had the same problem, then I solved this problem using `iframe`. [Here](http://stackoverflow.com/questions/16412930/pure-javascript-detect-form-submit-finished/16445138#16445138) explained how to upload image through `iframe` and get response after finished uploading. – Ikrom May 11 '13 at 09:59
  • 3
    Despite the opinion of two other posters, it is possible to upload an image via AJAX. Hint: HTML5 File API [W3C Editor's Draft](http://dev.w3.org/2006/webapi/FileAPI/) [MSDN](https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications) – Kiruse May 11 '13 at 10:05
  • If you use JQuery, I recommend http://blueimp.github.io/jQuery-File-Upload/ – mccannf May 11 '13 at 17:29
  • If you use jQuery OR plain 'ole javascript, I recommend [Fine Uploader](http://fineuploader.com). Full disclosure: I maintain Fine Uploader. – Ray Nicholus May 14 '13 at 14:14

1 Answers1

2

I think I got it. Go to http://jquery.malsup.com/form/progress.html and take a look at view page source.

vicky
  • 1,046
  • 2
  • 12
  • 25