开发者

How to handle image uploads with jquery post submit

开发者 https://www.devze.com 2023-03-18 02:37 出处:网络
I have the html form and i am submittng the form with jquery with following var queryString = $(\'.form1\').formSerialize();

I have the html form and i am submittng the form with jquery with following

var queryString = $('.form1').formSerialize(); 
 $.post('book/create/', quer开发者_如何学CyString); 

But if i submit form without ajax then image gets uploaded by django function

Now the problem is , it is ignoring the file fields. what should i do


You cannot upload files using XMLHttpRequest (AJAX).But you can try using some of the Ajax JQuery plugins to upload files

  • http://www.phpletter.com/Demo/AjaxFileUpload-Demo/
  • http://www.webtoolkit.info/ajax-file-upload.html

Also Check how-can-i-upload-files-asynchronously-with-jquery

0

精彩评论

暂无评论...
验证码 换一张
取 消