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++笔记(4)——引用及结构体

    引用 C++中有一个很方便的语法叫做引用,作用就是使得函数能够对传入的参数作出全局有效的改动.用法很简单,就是在传入参数的类型后面加上&就可以指明传入的参数是引用. 例子: #include ...

  2. 第一章:Java语言概述与环境开发

    1.计算机高级语言按程序的执行方式可以分为编译型和解释型两种: 2.JAVA程序的执行过程必须经过先编译后解释两个步骤: 3.JAVA语言里负责执行字节码文件的是JAVA虚拟机 (Java Virtu ...

  3. iis7 https配置方法并且http跳转https

    操作场景 本文档指导您如何在 IIS 中安装 SSL 证书. 说明: 本文档以证书名称 www.domain.com 为例. 本文档以操作系统 Windows10 为例.由于操作系统的版本不同,详细操 ...

  4. 003/node.js--代理服务(解决跨域问题)

    业务描述: 1.web前端发送http请求 2.web后端为https协议 如何保证web前端发送http请求到web后端(跨域问题:域名不一致即跨域), 因此用node.js写了个代理服务,转发前端 ...

  5. [Web 前端] 009 css 常用的文本样式设置

    常用的文本 css 样式 概览 参数 释义 举例 color 设置文字的颜色 color:red; font-size 设置文字的大小 font-size:12px; font-family 设置文字 ...

  6. [2019杭电多校第八场][hdu6667]Roundgod and Milk Tea

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6667 题目大意是说n个班级,每个班级有ai人和bi杯茶,每个人只能喝其他班的茶并且只能喝一杯.问最多有 ...

  7. (四:NIO系列) Java NIO Selector

    出处:Java NIO Selector 1.1. Selector入门 1.1.1. Selector的和Channel的关系 Java NIO的核心组件包括: (1)Channel(通道) (2) ...

  8. 前端开发JavaScript入门——JavaScript介绍&基本数据类型

    JavaScript 诞生于1995年,它的出现主要是用于处理网页中的 前端验证. • 所谓的前端验证,就是指检查用户输入的内容是否符合一定的 规则. • 比如:用户名的长度,密码的长度,邮箱的格式等 ...

  9. css炫酷动画收藏

    1.按钮.hover.input动画(cssfx) https://cssfx.dev/ 2.svg 矢量定制icon(ikonate) https://www.ikonate.com/#conten ...

  10. qemu-kvm使用

    创建镜像qemu-img create -f qcow2 test-vm.qcow2 10g 修改镜像大小qemu-img  resize  test-vm.qcow2 +10G   安装系统 qem ...