id: jQuery(this).attr('id'),//绑定的input的ID
langFile: 'http://www.static-xxx.nu/uploader/uploadifyLang_en.js',//语言包的路径,能设置所有的提示文字
swf: 'http://www.static-xxx.nu/uploader/uploadify.swf',//[必须设置]swf的路径
uploader: '/uploadify/galleri.php',//[必须设置]上传文件触发的url
auto:false,//文件选择完成后,是否自动上传
buttonText:'Välj Filer',//上传按钮的文字
height: 30,//上传按钮的高和宽
width: 120,
formData
buttonCursor: 'pointer',//上传鼠标hover后Cursor的形状
cancelImage: 'http://www.static-xxx.nu/uploadify-cancel.png',//[必须设置]取消图片的路径
checkExisting:'/uploader/uploadify-check-existing.php',//检查上传文件是否存,触发的url,返回1/0
debug: true,//debug模式开/关,打开后会显示debug时的信息
fileObjName:'file',
fileSizeLimit : 0,//文件的极限大小,以字节为单位,0为不限制。1MB:1*1024*1024
fileTypeDesc: 'Bild JPG',//允许上传的文件类型的描述,在弹出的文件选择框里会显示
fileTypeExts: '*.jpg',//允许上传的文件类型,限制弹出文件选择框里能选择的文件
method: 'post',//和后台交互的方式:post/get
multi: true,//是否能选择多个文件
queueID: 'fileQueue',//显示上传文件队列的元素id,可以简单用一个div来显示
queueSizeLimit : 999,//队列中允许的最大文件数目
progressData : 'all', // 'percentage''speed''all'//队列中显示文件上传进度的方式:all-上传速度+百分比,percentage-百分比,speed-上传速度
removeCompleted : true,//上传成功后的文件,是否在队列中自动删除
removeTimeout: 3,
requeueErrors : true,
postData: {},//和后台交互时,附加的参数
preventCaching : true,
transparent: true,
successTimeout : 30,//上传时的
timeoutuploadLimit:999//能同时上传的文件数目
设置的事件:
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,swfuploadifyQueueUploadSize) {//上传进度发生变更时触发
alert( 'id: ' + file.id
+ ' - 索引: ' + file.index
+ ' - 文件名: ' + file.name
+ ' - 文件大小: ' + file.size
+ ' - 类型: ' + file.type
+ ' - 创建日期: ' + file.creationdate
+ ' - 修改日期: ' + file.modificationdate
+ ' - 文件状态: ' + file.filestatus
+ ' - 当前文件已上传: ' + fileBytesLoaded
+ ' - 当前文件大小: ' + fileTotalBytes
+ ' - 队列已上传: ' + queueBytesLoaded
+ ' - 队列大小: ' + swfuploadifyQueueUploadSize);
}
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);
}
<a href="javascript:$('#uploadify').uploadify('cancel')">取消上传</a>
<a href="javascript:$('#uploadify').uploadify('upload')">上传a</a>
上传和取消上传JS如上
分享到:
相关推荐
自己花了2个小时整理的uploadify3.1与2.1.4的详细参数说明
uploadify3.1小示例 包含uploadify3.1的所有文件和示例
Uploadify3.1文件上传
uploadify 3.1 使用详解,描述了使用方法,还有各参数详解。
uploadify3.1,开发包,含说明文档,
Uploadify3.1 上传控件详细api
c#批量上传,可保存到数据库,可以读取显示,可以查看大图
文件上传组件 Uploadify-3.1-Demo实例详解
jquery uploadify3.1 与java 集成,包含有 页面,配置servlet web.xml 部署到tomcat中 ,即可使用。简单方便,页面中包含有 uploadify 3.1的 一些样式。可自行进行更改
uploadify3.1与Struts2配合使用。代码运行完美无错,upload因为版本问题,开发者的方法总是运行不起来,这个与Struts2结合的可以成功运行。
uploadify3.1 +formDate动态传值 Demo[PHP版本] 完整测试过的
Uploadify3.1参考手册中文版。 介绍了Uploadify插件的: 1.配置项 2.事件 3.方法
此为Uploadify3.1的中文参考手册,最新版3.2请去官网www.uploadify.com查看
本文主要介绍jQuery插件uploadify3.1的简单使用,希望能帮到大家,有需要的朋友可以参考一下。
jquery.uploadify-3.1.min.js 修改了SWFUpload.prototype.getFlashHTML ()方法,解决了在ie9在点击上传按钮后,不能弹出浏览文件的对话框问题。
uploadify参数配置详解
Uploadify是JQuery的一个上传插件,实现的效果非常不错,文档内容详细有条理 特别适合Uploadify初学者 api丰富
Jquery Uploadify使用参数详解
uploadify-v3.1 for eclipse
使用uploadify3.1实现文件批量上传