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. 优化内存_内存泄漏——C

    内存泄漏:  动态申请内存,没有正常释放,后续又申请内存,也没释放内存,导致内存池被全部被占用,最终再申请内存的时候失败:严格点则每次申请内存的时候判断申请到的指针是否为空,若为空NULL则表示申请失 ...

  2. 大数加减(51nod)

    1005 大数加法 给出2个大整数A,B,计算A+B的结果.     输入 第1行:大数A 第2行:大数B (A,B的长度 <= 10000 需注意:A B有可能为负数) 输出 输出A + B ...

  3. Python 中的垃圾回收机制

    GC作为现代编程语言的自动内存管理机制,专注于两件事:1. 找到内存中无用的垃圾资源 2. 清除这些垃圾并把内存让出来给其他对象使用.GC彻底把程序员从资源管理的重担中解放出来,让他们有更多的时间放在 ...

  4. Tornado 的核是什么??

    Tornado 的核心是 ioloop 和 iostream 这两个模块,前者提供了一个高效的 I/O 事件循环,后 者则封装了 一个无阻塞的 socket .通过向 ioloop 中添加网络 I/O ...

  5. 问题 K: WaWa的难题

    问题 K: WaWa的难题 时间限制: 1 Sec  内存限制: 128 MB提交: 570  解决: 125[提交] [状态] [命题人:jsu_admin] 题目描述 HaHa和WaWa是好朋友, ...

  6. LED音乐频谱之点阵

    转载请注明出处:http://blog.csdn.net/ruoyunliufeng/article/details/37967455 一.硬件 watermark/2/text/aHR0cDovL2 ...

  7. 5.canvas

    1.canvas:固定语句:定义画布/设置绘图环境为2d. 2.canvas样式:lineWidth线宽/strokeStyle绘制样式. 3.canvas绘制矩形: Context.moveTo(x ...

  8. JDK_1.8的Windows和Linux环境下的下载与安装

    下载: Eclipse需要Jdk,MyEclipse有自带的Jdk 直接点击下载. Windows下JDK安装: 双击运行程序 下一步: 路径 更改到E:\Software\Java\jre1.8.0 ...

  9. vue实现搜索功能

    vue实现搜索功能 template 部分 <!-- 搜索页面 --> <template> <div> <div class="goback&qu ...

  10. HTTPS证书转换成PEM格式

    PEM 格式的证书文件(*.pem)一般为以下格式: 注意:PEM 格式证书文件可用 notepad++ 等文本编辑器打开. CER / CRT 格式证书转换为 PEM 格式 对于 CER / CRT ...