If your server is not returning JSON, try removing:

dataType: 'json'

Otherwise you may be ending up with a fail event, which is easy to test for:

fail: function(e, data) {
alert('Fail!');
}

https://github.com/blueimp/jQuery-File-Upload/wiki/Options#datatype

AJAX Options

The jQuery File Upload plugin makes use of jQuery.ajax() for the file upload requests. This is true even for browsers without support for XHR, thanks to the Iframe Transport plugin.

The options set for the File Upload plugin are passed to jQuery.ajax() and allow to define any ajax settings or callbacks.
The ajax options processData, contentType and cache are set to false for the file uploads to work and should not be changed.
The timeout setting is set to 0. See pull request #3399 for the reasoning behind this.
The following options are also set by the plugin, but can be useful to customize:

url

A string containing the URL to which the request is sent.
If undefined or empty, it is set to the action property of the file upload form if available, or else the URL of the current page.

  • Type: string
  • Example: '/path/to/upload/handler.json'

type

The HTTP request method for the file uploads. Can be "POST", "PUT" or "PATCH" and defaults to "POST".

  • Type: string
  • Example: 'PUT'

Note:
"PUT" and "PATCH" are only supported by browser supporting XHR file
uploads, as iframe transport uploads rely on standard HTML forms which
only support "POST" file uploads. See Browser support.
If the type is defined as "PUT" or "PATCH", the iframe transport will
send the files via "POST" and transfer the original method as "_method"
URL parameter.

Note:
As was noted above, it's a common practice to use "_method" to transfer
the type of your request. For example, "Ruby on Rails" framework uses a
hidden input with the name "_method" within each form, so it will likely
override the value that you will set here.

dataType

The type of data that is expected back from the server.

Note: The UI version of the File Upload plugin sets this option to "json" by default.

    • Type: string
    • Example: 'json'

done

Callback for successful upload requests. This callback is the equivalent to the success callback provided by jQuery ajax() and will also be called if the server returns a JSON response with an error property.

  • Example:
function (e, data) {
// data.result
// data.textStatus;
// data.jqXHR;
}

jQuery FileUpload doesn't trigger 'done'的更多相关文章

  1. jQuery FileUpload等插件的使用实例

    1.jQuery FileUpload 需要的js: jquery.js jquery.fileupload.js jquery.iframe-transport.js jquery.xdr-tran ...

  2. 另一种图片上传 jquery.fileupload.js

    今天遇到另外一种上传图片方法 用jquery.fileupload.js <input type="file" name="file[]" multipl ...

  3. jquery.fileupload插件的简易使用日志

    来源:http://yixiandave.iteye.com/blog/1897330 本文内容主要包含fileupload插件传递参数和取回服务器返回数据的方法 jquery.fileupload官 ...

  4. 关于jquery.fileupload结合PHP上传图片的开发用法流程

    这阵子做了一个项目,涉及到了图片上传,以往用的都是uploadify这个插件,感觉它在PC上的使用还是很强大的, 不过最近这个项目涉及到了移动端的上传,其实uploadify也可以,但是他有一个 up ...

  5. MVC文件上传-使用jQuery.FileUpload和Backload组件实现文件上传

    本篇使用客户端jQuery-File-Upload插件和服务端Badkload组件实现多文件异步上传.MVC文件上传相关兄弟篇: 处理文件上传的服务端组件Backload 用于处理文件上传的服务端组件 ...

  6. 使用jQuery.FileUpload插件和服Backload组件自定义上传文件夹

    在零配置情况下,文件的上传文件夹是根目录下的Files文件夹,如何自定义文件的上传文件夹呢? □ 在web.config中配置 1: <configuration> 2: <conf ...

  7. 使用jQuery.FileUpload和Backload自定义控制器上传多个文件

    当需要在控制器中处理除了文件的其他表单字段,执行控制器独有的业务逻辑......等等,这时候我们可以自定义控制器. 通过继承BackloadController □ 思路 BackloadContro ...

  8. 使用jQuery.FileUpload插件和Backload组件裁剪上传图片

    □ 思路 1.自定义控制器继承Backload的默认控制器BackloadController2.自定义一个jQuery File Upload初始化js文件,使用自定义控制器的方法3.在视图页面调用 ...

  9. jquery 自动触发事件 trigger

    trigger() 栗子: 需求:我们在做二级联动的时候往往会遇到这样的需求,后台管理端页面加载完成后显示用户的省份,城市,并且可以对用户的省份,城市信息可以修改 如果只是简单的显示 你完全可以直接放 ...

随机推荐

  1. xshell输入字母空格间距变大

    按一下shift+空格(全角/半角转换的快捷键,引起的问题)

  2. maven build失败 (Failure to find io.renren:renren-security:pom:3.2.0 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository...)

      今天mvn clean package一个子工程(renren-admin)时报错: Failed to execute goal on project renren-admin: Could n ...

  3. C# DataSet转JSON

    经常会遇到系统数据交互采用JSON数据格式进行交互的,避免不必要的重复工作,记录下自己的处理方式. 获取数据集之后,通过函数对数据集信息进行整理通过.Net Framework3.5提出的JavaSc ...

  4. MD5加密 和 自定义加密解密

    public class EncryptString { /// <summary> /// MD5加密 /// </summary> /// <param name=& ...

  5. window.onload后跟函数 和跟函数名的区别【window.onload = asd() 和 window.onload = asd 】

    window.onload:页面加载完毕执行[DOM tree + 外部图片 + 资源] <script> function asd(){ return 10; } window.onlo ...

  6. 什么是服务端伪造(SSRF)

    什么是服务端伪造(SSRF) 原文:GitHub Pages and Single-Page Apps 译者:neal1991 welcome to star my articles-translat ...

  7. 通过离线安装包解决了 from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: /usr/local/python36/lib/python3.6/site-packages/cryptography-2.2.2-py3.6-linux-x86_64.egg/cryptography/hazmat/binding

    场景:内网服务器不能上外网(代理也不通!), 之前安装了PYTHON的几个安装包,但不是知道为什么无法使用PARAMIKO这个模块 在导入 from cryptography.hazmat.bindi ...

  8. 【vue】父子组件间通信----传函数

    (一)子组件 调用 父组件 方法 方式一) 子组件中通过this.$parent.event来调用父组件的方法 父组件 <template> <div> <child&g ...

  9. linux 调整内核优化

    所谓内核优化,主要是在 linux 中针对业务服务应用而进行的系统内核参数优化,优化并无特殊的 标准,下面以常见生产环境 linux 的内核优化为例讲解,仅供大家参考: 内核调优 #vi /etc/s ...

  10. Linux性能优化从入门到实战:16 文件系统篇:总结磁盘I/O指标/工具、问题定位和调优

    (1)磁盘 I/O 性能指标 文件系统和磁盘 I/O 指标对应的工具 文件系统和磁盘 I/O 工具对应的指标 (2)磁盘 I/O 问题定位分析思路 (3)I/O 性能优化思路 Step 1:首先采用 ...