jQuery FileUpload doesn't trigger 'done'
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'的更多相关文章
- jQuery FileUpload等插件的使用实例
1.jQuery FileUpload 需要的js: jquery.js jquery.fileupload.js jquery.iframe-transport.js jquery.xdr-tran ...
- 另一种图片上传 jquery.fileupload.js
今天遇到另外一种上传图片方法 用jquery.fileupload.js <input type="file" name="file[]" multipl ...
- jquery.fileupload插件的简易使用日志
来源:http://yixiandave.iteye.com/blog/1897330 本文内容主要包含fileupload插件传递参数和取回服务器返回数据的方法 jquery.fileupload官 ...
- 关于jquery.fileupload结合PHP上传图片的开发用法流程
这阵子做了一个项目,涉及到了图片上传,以往用的都是uploadify这个插件,感觉它在PC上的使用还是很强大的, 不过最近这个项目涉及到了移动端的上传,其实uploadify也可以,但是他有一个 up ...
- MVC文件上传-使用jQuery.FileUpload和Backload组件实现文件上传
本篇使用客户端jQuery-File-Upload插件和服务端Badkload组件实现多文件异步上传.MVC文件上传相关兄弟篇: 处理文件上传的服务端组件Backload 用于处理文件上传的服务端组件 ...
- 使用jQuery.FileUpload插件和服Backload组件自定义上传文件夹
在零配置情况下,文件的上传文件夹是根目录下的Files文件夹,如何自定义文件的上传文件夹呢? □ 在web.config中配置 1: <configuration> 2: <conf ...
- 使用jQuery.FileUpload和Backload自定义控制器上传多个文件
当需要在控制器中处理除了文件的其他表单字段,执行控制器独有的业务逻辑......等等,这时候我们可以自定义控制器. 通过继承BackloadController □ 思路 BackloadContro ...
- 使用jQuery.FileUpload插件和Backload组件裁剪上传图片
□ 思路 1.自定义控制器继承Backload的默认控制器BackloadController2.自定义一个jQuery File Upload初始化js文件,使用自定义控制器的方法3.在视图页面调用 ...
- jquery 自动触发事件 trigger
trigger() 栗子: 需求:我们在做二级联动的时候往往会遇到这样的需求,后台管理端页面加载完成后显示用户的省份,城市,并且可以对用户的省份,城市信息可以修改 如果只是简单的显示 你完全可以直接放 ...
随机推荐
- Web前端开发 --》 如何实现页面同时在移动端和pc端的兼容问题
很简单,只需要在html文件中对你引入的css进行一个类似于媒体查询的操作 <!DOCTYPE html> <html lang="en"> <hea ...
- C++学习笔记(五)--指针、NULL、引用
1. C++中已经定义了NULL为0:#define NULL 0 指针p可以指向空值NULL即 p = NULL;表示该指针变量不指向任何变量. 注意:指针未初始化与指针为NULL不同, p = N ...
- webpack打包html里的img图片
对待css里的图片, 因为已经通过引入css文件到js,打包了,可以正常通过module.rules.test检测到,然后正常打包. 但是对于html里的图片, 这个需要安装一个插件html-with ...
- vueStudy
目录层次: 目前学习曲线有三个前端开发,每个人有各自的目录,可以很好地对比彼此的代码. unit1 邮箱验证 用户名 数字.字母.中文 .划线不能以下划线开头 2-12位 密码验证 6-20位英文和 ...
- F. Fixing Banners
http://codeforces.com/gym/102394/problem/F F. Fixing Banners time limit per test 1 second memory lim ...
- 一键生成APK
傻瓜式的生成APK网址:https://www.appbsl.com/ 第一步 第二步 第三步 第四步
- day20 博客系统开发
setting 文件加入 AUTH_USER_MODEL = "app名称.UserInfo" from django.db import models # Create ...
- FZUOJ-2275 Game
Problem 2275 Game Accept: 159 Submit: 539 Time Limit: 1000 mSec Memory Limit : 262144 KB Pro ...
- 待补 http://acm.hdu.edu.cn/showproblem.php?pid=6602
http://acm.hdu.edu.cn/showproblem.php?pid=6602 终于能够看懂的题解: https://blog.csdn.net/qq_40871466/article/ ...
- 入手node
一.安装node(查询使用npm) 二.安装淘宝镜像(查询使用cnpm,安装淘宝镜像之后下载速度会更快) 三.安装相关资料时,在预安装的文件夹使用: shift + 右键, 打开命令行窗口,进入终端