JQuery上传插件uploadify整理(Events)

Arguments
- file
The file object being cancelled
onCancel:调用calcel方法。$('#upload').uploadify('cancel');
\
Arguments
- queueItemCount
The number of queue items that are being cancelled.
onClearQueue:调用cancel方法,传一个'*'参数。$('#upload').uploadify('cancel','*');
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Demo.aspx.cs" Inherits="JQ_uploadify.Demo" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<link href="/css/css.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery-1.8.3.js" type="text/javascript"></script>
<script src="/uploadify/jquery.uploadify.js" type="text/javascript"></script>
<style type="text/css"> </style>
<script type="text/javascript">
$(function () {
$("#upload").uploadify({
'swf': '/uploadify/uploadify.swf',
'uploader': '/ashx/upload.ashx',
'onClearQueue': function (queueItemCount) { alert(queueItemCount); }
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="file" name="upload" value="上传" id="upload" />
<input type="button" name="" value="取消" onclick="$('#upload').uploadify('cancel','*');" />
</div>
</form>
</body>
</html>
onClearQueue

onDestroy:调用destroy方法。$('#upload').uploadify('destroy');

Arguments
- queueData
The queueData object containing information about the queue:- filesSelected
The number of files selected in browse files dialog - filesQueued
The number of files added to the queue (that didn’t return an error) - filesReplaced
The number of files replaced in the queue - filesCancelled
The number of files that were cancelled from being added to the queue (not replaced) - filesErrored
The number of files that returned an error
- filesSelected
onDialogClose:浏览文件对话框关闭时触发。如果此事件被重写,出错不会提示错误信息。

onDialogOpen:浏览文件对话框打开时触发。

onDisable:$('#upload').uploadify('disable', true);

onEnable:$('#upload').uploadify('disable', false);

onFallback:Flash版本与浏览器不兼容触发。

Arguments
- instance
The instance of the uploadify object
onInit:初始化事件。

Arguments
- queueData
The queueData object containing information about the queue:- uploadsSuccessful
The number of uploads that were successfully completed - uploadsErrored
The number of uploads that returned an error
- uploadsSuccessful
onQueueComplete:进入队列完成。

Arguments
- file
The file object that was selected.
onSelect:从浏览文件对话框选择放入到队列时触发。

Arguments
- file
The file object that returned the error. - errorCode
The error code that was returned. The following constants can be used when determining the error code:- QUEUE_LIMIT_EXCEEDED – The number of files selected will push the size of the queue passed the limit that was set.
- FILE_EXCEEDS_SIZE_LIMIT – The size of the file exceeds the limit that was set.
- ZERO_BYTE_FILE – The file has no size.
- INVALID_FILETYPE – The file type does not match the file type limitations that were set.
- errorMsg
The error message indicating the value of the limit that was exceeded.
*You can access a full error message using ‘this.queueData.errorMsg’ if you do not override the default event handler.
onSelectError:只要上传发生错误,此事件都能捕捉到。

onSWFReady:Flash对象加载完毕时触发。

onUploadComplete:上传完成时触发,无法判断上传成功或失败。

Arguments
- file
The file object that was uploaded - errorCode
The error code that was returned - errorMsg
The error message that was returned - errorString
The human-readable error message containing all the details of the error
onUploadError:上传失败时触发。

Arguments
- file
The file object being uploaded - bytesUploaded
The number of bytes of the file that have been uploaded - bytesTotal
The total number of bytes of the file - totalBytesUploaded
The total number of bytes uploaded in the current upload operation (all files) - totalBytesTotal
The total number of bytes to be uploaded (all files)
onUploadProgress:显示已经上传的大小。

Arguments
- file
The file object that is about to be uploaded
onUploadStart:开始上传时触发。

onUploadSuccess:上传成功时触发。
最后测一下,各个事件的执行顺序。
程序如下:
$(function () {
$("#upload").uploadify({
'auto': true,
'swf': '/uploadify/uploadify.swf',
'uploader': '/ashx/upload.ashx',
'onDialogClose': function () { alert('onDialogClose'); },
'onDialogOpen': function () { alert('onDialogOpen'); },
'onInit': function () { alert('onInit'); },
'onQueueComplete': function () { alert('onQueueComplete'); },
'onSelect': function () { alert('onSelect'); },
'onSWFReady': function () { alert('onSWFReady'); },
'onUploadComplete': function () { alert('onUploadComplete'); },
'onUploadProgress': function () { alert('onUploadProgress'); },
'onUploadStart': function () { alert('onUploadStart'); },
'onUploadSuccess': function () { alert('onUploadSuccess'); }
});
});
1、
2、
3、
4、
5、
6、
7、
8、
9、
10、
JQuery上传插件uploadify整理(Events)的更多相关文章
- JQuery上传插件uploadify整理(Options)
下载 现在有两个版本了,我此次使用的依然是Flash版本的,虽然现在绝大部分浏览器都兼容HTMKL5,目前位置,除了做手机项目外,一般我们项目中不允许使用HTML5标签. 属性介绍(Options) ...
- JQuery上传插件uploadify优化
旧版的uploadify是基于flash上传的,但是总有那么些问题,让我们用的不是很舒服.今天主要分享下在项目中用uploadify遇到的一些问题,以及优化处理 官方下载 官方文档 官方演示 下面是官 ...
- jquery上传插件uploadify 报错http error 302 解决方法之一
前段时间用到jquery上传插件uploadify时,始终出现系统报出 http error 302 的错误. 网上大量搜集信息,基本上都是说session值丢失的问题,根据网友提供的解决方案进行修改 ...
- 【转】JQuery上传插件Uploadify使用详解及错误处理
转自:http://www.jb51.net/article/43498.htm 关于JQuery上传插件Uploadify使用详解网上一大把,基本上内容都一样.我根据网上的步骤配置完成后,会报一些错 ...
- JQuery上传插件Uploadify使用详解
本文转载http://www.cnblogs.com/oec2003/archive/2010/01/06/1640027.html Uploadify是JQuery的一个上传插件,实现的效果非常不错 ...
- (转)JQuery上传插件Uploadify使用详解
原文地址:http://www.cnblogs.com/oec2003/archive/2010/01/06/1640027.html Uploadify是JQuery的一个上传插件,实现的效果非常不 ...
- jQuery上传插件Uploadify使用帮助
Uploadify是JQuery的一个上传插件,实现的效果非常不错,带进度显示.它的功能特色总结如下: 支持单文件或多文件上传,可控制并发上传的文件数 在服务器端支持各种语言与之配合使用,诸如PHP, ...
- JQuery上传插件Uploadify使用详解 asp.net版
先来一个实例 Uploadify插件是JQuery的一个文件支持多文件上传的上传插件,ajax异步上传,实现的效果非常不错,带进度显示.不过官方提供的实例时php版本的,本文将详细介绍Uploadif ...
- jQuery上传插件Uploadify 3.2在.NET下的详细例子
项目中要使用Uploadify 3.2来实现图片上传并生成缩略通的功能,特此记下来,以供各位参考! Uploadify下载地址:http://www.uploadify.com/download/ 下 ...
随机推荐
- C语言qsort函数用法
qsort函数简介 排序方法有很多种:选择排序,冒泡排序,归并排序,快速排序等. 看名字都知道快速排序是目前公认的一种比较好的排序算法.因为他速度很快,所以系统也在库里实现这个算法,便于我们的使用. ...
- MySQL【Update误操作】回滚(转)
前言: 继上一篇MySQL[Delete误操作]回滚之后,现在介绍下Update回滚,操作数据库时候难免会因为“大意”而误操作,需要快速恢复的话通过备份来恢复是不太可能的,因为需要还原和bi ...
- Linux下Memcached-1.4.10安装
memcache是一款流行的缓存产品,它分为两个部分:一个是运行在服务器端的memcached进程,一个是在客户端进行调用获取缓存中数据客户端,例如比较常用的PHP客户端.这里,记录一下安装服务器端的 ...
- 动态代理到基于动态代理的AOP
动态代理,是java支持的一种程序设计方法. 动态代理实现中有两个重要的接口和类,分别是InvocationHandler(interface),Proxy(class). 要实现动态代理,必须要定义 ...
- scala之method和function的区别
在我没有学习scala的时候,主要用java和python做日常工作开发,印象中,没有特别的刻意的去区分method和function的区别,这个关系,正如我们日常生活中,没有刻意的去区分质量和重量. ...
- IE11登陆交行网银崩溃
1.打开IE11兼容性视图 2.交通银行就填入95559.com.cn 3.重新打开IE11登录网银
- WINDOWS黑客基础(5):利用内存来进行获取计算结果
在前面的注入代码的章节中,我们利用了VirtualAllocEx来在对方的进程开辟了一块内存,并且将代码复制进对方进程的内存里面,从而执行那段内存的代码,但是这里有一个问题,就是代码不是执行在我们进程 ...
- JS URL 使用base64加密与解密
JS编码方式: <script type="text/javascript"> document.write(encodeURI("http://www.w3 ...
- oracle imp导入数据到另一个表空间
http://blog.163.com/darlingchenlin@126/blog/static/7156283420100531431855/ 1.在第一个数据库导出数据:qlyg_xs_db_ ...
- codeforces 323A. Black-and-White Cube 构造
输入n 1 <= n <= 100 有一个n * n * n 的立方体,由n ^ 3 个1 * 1 * 1 的单位立方体构成 要用white 和 black 2种颜色来染这n ^ 3个立方 ...