【问题标题】:How to handle image uploads with jquery post submit如何使用 jquery post submit 处理图像上传
【发布时间】:2011-09-29 08:43:31
【问题描述】:

我有 html 表单,我正在使用 jquery 提交表单,并带有以下内容

var queryString = $('.form1').formSerialize(); 
 $.post('book/create/', queryString); 

但是如果我提交没有 ajax 的表单,那么图像会被 django 函数上传

现在的问题是,它忽略了文件字段。我该怎么办

【问题讨论】:

    标签: jquery ajax image-upload jqueryform


    【解决方案1】:

    您无法使用 XMLHttpRequest (AJAX) 上传文件。但是您可以尝试使用一些 Ajax JQuery 插件上传文件

    同时检查how-can-i-upload-files-asynchronously-with-jquery

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-02
      • 2018-04-23
      • 2015-08-13
      • 1970-01-01
      • 1970-01-01
      • 2012-02-17
      • 2022-12-14
      相关资源
      最近更新 更多