`
wangliang0209
  • 浏览: 23578 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

uploadify v3.1使用

 
阅读更多
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如上


uploadify3.1版方法


分享到:
评论

相关推荐

    UPLOADIFY v3.1 基于jquery的上传插件.zip

    UPLOADIFY v3.1 基于jquery的上传插件.zip

    uploadify-v3.1 for eclipse

    uploadify-v3.1 for eclipse

    整理uploadify-v3.1.NET开发包

    提到上传,就会想到file标签。但是如果文件过大,或者多个文件的时候,这个html标签就有点力不从心了,下面主要讨论php后台来处理多线程上传...正因为自带标签的局限性,所以就有了今天的这个Uploadify这个插件的诞生。

    asp.net实现的基于uploadify-v3.1的文件批量上传

    asp.net实现的基于uploadify-v3.1的文件批量上传, 带进度条

    uploadify-v3.1开发包、中文文档

    一直寻找java上传的好解决方案,最近看了uploadify-v3.1上传,效果不错,但一直上传不成功,经过几天找资料解决了,现整理出demo程序和中文文档希望对需要的人有帮助

    Jquery上传插件 uploadify v3.1使用说明

    使用方法(.net版本): 前台JS 代码如下: $(“#id”).uploadify({ height: 30, swf: ‘/uploadify/uploadify.swf’, uploader: ‘/Handler/uploadPic.ashx’, width: 120, cancelImg: ‘/uploadify/uploadify-ca

    uploadifyv3.1示例---jsp版

    最近需要做一个批量上传图片的功能 用了很多方法,有的很复杂,有的没有成功 最后用了uploadify,去网上下了个最新的3.1版本,但是网上多数都是2.×的例子,已经有很多...所以自己写了一个uploadify-v3.1图片上传功能

    jQuery无刷新上传之uploadify3.1简单使用

    不过网上的这几篇文章用到的uploadify还是以前的旧版本uploadify-v2.1.0,我在官网上下载的是uploadify-v3.1版,其中的一些参数以及调用方法也不同了,还好官网有帮助文档。 (唯一感觉不爽的一点就是这个开发包是...

    博客 v1.2源码20121013

    jquery.uploadify-3.1.js:多文件(图片)上传 kindeditor编辑器 kindeditor编辑器在mvc3中的应用,主要是文件(图片)上传部分的改造 SyndicationFeed 文章以及评论rss Ninject 实现Models层与Controllers...

    asp.net uploadify实现多附件上传功能

    本文实例为大家分享了asp.net uploadify多附件上传的方法,供大家参考,具体内容如下 1、说明  uploadify是一款优秀jQuery插件,主要功能是批量上传文件。... Uploadify:uploadify-v3.1  Jquery:jquery-1.

    jQuery无刷新上传之uploadify简单代码

     不过园子里的这几篇文章用到的uploadify还是以前的旧版本uploadify-v2.1.0,我在官网上下载的是uploadify-v3.1版,其中的一些参数以及调用方法也不同了,还好官网有帮助文档。 (唯一感觉不爽的一点就

    基于asp.net实现图片在线上传并在线裁剪功能

    1、说明  接上一篇文章asp.net uploadify实现多附件上传功能完成后,又突然用到头像上传并在线裁剪。... Uploadify:uploadify-v3.1  Jquery:jquery-1.9.0.js  最后我会将整个Demo上传,如果同学

    asoft签到管理系统tykq3.5_build20110125

    5、v3.1正式版UI替换结束,正式版将启用全新界面。 6、新增“在办箱” 功能,您能方便的看到自己的工作情况,并能方便的查询联系薄、最近的操作记录 7、新增 user_zw字段 用于储存用户职务 [2009-7-22] v3.1 ...

Global site tag (gtag.js) - Google Analytics