jquery插件uploadify3.1 上传组件
来源:互联网 发布:国家的顶级域名 编辑:程序博客网 时间:2024/05/16 18:51
最近在测试使用一个jquery插件uploadify,最新版3.1
在网上找到一些资料,整理收藏一些.
onSelect : function(file){}//这个方法就是当选择了图片了触发的事件
onUploadComplete : function(file){}//这个方法是当图片上传完成后触发的事件
$(function(){
});
这里的formData是指同文件一起发送的数据,默认是post
因为它用的是swfupload,所以是支持跨域的,在根目录下建个crossdomain.xml文件
<?xmlversion="1.0"?>
<!DOCTYPEcross-domain-policy SYSTEM"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
</cross-domain-policy>
完成这些就差不多了,还得靠自己啊,网站有时太坑人了
onDialogClose :function(swfuploadifyQueue) {//当文件选择对话框关闭时触发
if( swfuploadifyQueue.filesErrored > 0){
alert( '添加至队列时有'
+swfuploadifyQueue.filesErrored
+'个文件发生错误n'
+'错误信息:'
+swfuploadifyQueue.errorMsg
+'n选定的文件数:'
+swfuploadifyQueue.filesSelected
+'n成功添加至队列的文件数:'
+swfuploadifyQueue.filesQueued
+'n队列中的总文件数量:'
+swfuploadifyQueue.queueLength);
}
}
onDialogOpen :function() {//当选择文件对话框打开时触发
alert( 'Open!');
}
onSelect :function(file) {//当每个文件添加至队列后触发
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus);
}
onSelectError :function(file,errorCode,errorMsg) {//当文件选定发生错误时触发
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 错误代码: ' + errorCode
+ ' - 错误信息: ' + errorMsg);
}
onQueueComplete :function(stats) {//当队列中的所有文件全部完成上传时触发
alert( '成功上传的文件数: ' + stats.successful_uploads
+ ' - 上传出错的文件数: ' + stats.upload_errors
+ ' - 取消上传的文件数: ' + stats.upload_cancelled
+ ' - 出错的文件数' + stats.queue_errors);
}
onUploadComplete :function(file,swfuploadifyQueue) {//队列中的每个文件上传完成时触发一次
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 出错的文件数: ' + swfuploadifyQueue.filesErrored
+ ' - 错误信息: ' + swfuploadifyQueue.errorMsg
+ ' - 要添加至队列的数量: ' + swfuploadifyQueue.filesSelected
+ ' - 添加至对立的数量: ' + swfuploadifyQueue.filesQueued
+ ' - 队列长度: ' + swfuploadifyQueue.queueLength);
}
onUploadError :function(file,errorCode,errorMsg,errorString,swfuploadifyQueue){//上传文件出错是触发(每个出错文件触发一次)
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 错误代码: ' + errorCode
+ ' - 错误描述: ' + errorMsg
+ ' - 简要错误描述: ' + errorString
+ ' - 出错的文件数: ' + swfuploadifyQueue.filesErrored
+ ' - 错误信息: ' + swfuploadifyQueue.errorMsg
+ ' - 要添加至队列的数量: ' + swfuploadifyQueue.filesSelected
+ ' - 添加至对立的数量: ' + swfuploadifyQueue.filesQueued
+ ' - 队列长度: ' + swfuploadifyQueue.queueLength);
}
onUploadProgress :function(file,fileBytesLoaded,fileTotalBytes,
queueBytesLoaded,swfuploadifyQueueUploadS
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 当前文件已上传: ' + fileBytesLoaded
+ ' - 当前文件大小: ' + fileTotalBytes
+ ' - 队列已上传: ' + queueBytesLoaded
+ ' - 队列大小: ' + swfuploadifyQueueUploadS
}
onUploadStart:function(file) {//上传开始时触发(每个文件触发一次)
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus );
}
onUploadSuccess :function(file,data,response) {//上传完成时触发(每个文件触发一次)
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 服务器端消息: ' + data
+ ' - 是否上传成功: ' + response);
}
- jquery插件uploadify3.1 上传组件
- uploadify3.2 jquery上传组件
- jquery插件 jsp+servlet+uploadify3.1 文件上传
- jquery插件 jsp+servlet+uploadify3.1 文件上传
- jQuery uploadify3.2 上传组件bug
- spring mvc+jquery uploadify3.1上传
- servlet+uploadify3.1实现文件的上传
- springMVC+uploadify3.1 文件上传 demo
- uploadify3.1--3.2 HTTP&nbsp…
- jQuery-uploadify3.2带有滚动条的文件上传
- jquery文件批量上传控件Uploadify3.2(java springMVC)
- jquery文件批量上传控件Uploadify3.2(java springMVC)
- 插件 组件 控件
- Uploadify3.2.1上传文件
- jquery uploadify3.2 bug
- jQuery uploadify3.2使用
- 【uploadify3.1使用二】批量文件、图片上传
- jquery 插件开发学习1
- 项目管理笔记
- 九大JSP内置对象
- java List 的倒序问题
- 关于java jdbc 动态加载驱动jar包
- 关于文件的字符集编码探测--java
- jquery插件uploadify3.1 上传组件
- DB2--初步学习之系统表
- 图标-各类图片-UI图-网站收藏
- 关于用户体验的一些观点收集
- javascript常用语句收集
- setjmp与longjmp原理分析
- Extjs4中时间范围的控制(开…
- 为何声明语句不能放到if后面
- js 关于中文字符串的一些处理