0

I am using ajax submit to post values to my php file along with some file inputs in it. It is not serializing my file and i found out that jquery only does this for form elements excluding file inputs. Can anyone please help me do this.

  • You can do it with HTML+ PHP + jQuery as mentioned here http://stackoverflow.com/questions/10899384/uploading-both-data-and-files-in-one-form-using-ajax – Sachin Gadagi Aug 01 '14 at 12:19

1 Answers1

-1

You can't submit file data with the basic jQuery ajax function.

I suggest using the jQuery Form Plugin which works really well with ajax uploads and is easy to implement.

Edit: You can upload files via ajax using the FormData interface, however it is not supported by IE lower than 10. I still recommend using the plugin mentioned above.

Vlad Cazacu
  • 1,520
  • 12
  • 12