0

i am trying to submit the form which contains an image to server using ajax.

it is very important to use ajax, so is it possible to upload an image using ajax? google isnot helping me as i thought. i want that the window wont be reloaded once i submit the form with image inside. i am lazy to make another template for uoloaded-site...

uploading image needs enctype="multipart/form-data" but is there some ajax solution also?

thanks, appreciate any view and help

doniyor
  • 36,596
  • 57
  • 175
  • 260
  • This answer helped me: http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery?rq=1 – susie derkins Apr 10 '13 at 18:44

3 Answers3

1

Yes you can upload images using AJAX request

there are many library but I am using this

Anoop
  • 23,044
  • 10
  • 62
  • 76
1

You can upload any file using the FILE API, but the easiest way would probably to submit that form into a iframe... Same result less effort.

Steffen Heil
  • 4,286
  • 3
  • 32
  • 35
1

You could use jquery and the form plugin. This plugin allows you to submit a form using ajax, including file uploads.

Vero
  • 1,742
  • 3
  • 15
  • 29