`

uploadify3.1版本参数使用详解

阅读更多

使用:

    绑定的界面元素<input id='gallery'type='file'/>$("#gallery").uploadify({设置参数,参数如下});

设置的属性:

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: null,
      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);
} 

 jsp:

<a href="javascript:$('#uploadify').uploadify('cancel')">取消上传</a>
<a href="javascript:$('#uploadify').uploadify('upload')">上传</a>
分享到:
评论

相关推荐

    Uploadify3.1参数详解

    ### Uploadify3.1 参数详解 #### 一、概述 Uploadify是一款基于jQuery的文件上传插件,提供了丰富的自定义选项以及良好的用户体验。其特点包括支持上传进度显示、多文件上传等功能。本篇文章将详细介绍Uploadify3.1...

    uploadify 3.1 使用详解.doc

    ### Uploadify 3.1 使用详解 #### 一、简介 Uploadify 是一款非常流行的用于文件上传的 jQuery 插件,它支持拖拽文件、预览图片等多种功能,并且能够很好地与现有的 Web 应用集成。本文档将详细介绍 Uploadify 3.1...

    uploadify3.1 +formDate动态传值 Demo[PHP版本]

    《基于uploadify3.1的PHP动态传值实践详解》 在Web开发中,文件上传功能是不可或缺的一部分,而Uploadify3.1是一款强大的JavaScript插件,它使得文件上传变得简单且具有良好的用户体验。本教程将详细介绍如何在PHP...

    文件上传组件 Uploadify-3.1-Demo实例详解

    ### 文件上传组件 Uploadify-3.1-Demo实例详解 #### 概述 Uploadify是一款功能强大且易于使用的文件上传组件,它通过Flash技术实现,能够帮助开发者在Web应用中轻松实现文件上传功能。本篇内容将围绕Uploadify 3.1...

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

    《UPLOADIFY v3.1:基于jQuery的高效上传插件详解》 在现代网页开发中,用户交互体验的提升已经成为了一项重要的设计考量,而文件上传功能作为网页交互中的常见需求,其便捷性和用户体验至关重要。UPLOADIFY v3.1...

    jquery上传插件uploadify与php

    uploadify插件与php的结合,有上传后小图预览,带删除链接,中文转码,有注释,还有uploadify3.1的参数详解word文档。ps:自己学习jquery权威指南时遇到的问题,找了很堵资料,还是摸索出来了,php的处理不是很详细,...

    jquery uploadify 的组合心得(安装篇).docx

    《jQuery Uploadify 组合与安装详解》 在网页开发中,JavaScript库jQuery因其简洁的API和丰富的功能,被广泛应用于交互式设计。而在众多上传插件中,jQuery Uploadify以其出色的性能和易于定制的特点脱颖而出。...

    jQuery文件上传控件 Uploadify 详解

    要使用 Uploadify,你需要确保环境满足以下条件:jQuery 版本 1.4 或以上,以及 Flash Player 9.0.24 或更高版本。Uploadify 提供了 Flash 和 HTML5 两种实现方式,其中 HTML5 版本是付费的,本文主要介绍免费的 ...

    Jquery上传demo

    **jQuery Upload 演示详解** 在Web开发中,文件上传功能是不可或缺的一部分,而jQuery作为一款广泛使用的JavaScript库,提供了许多便捷的方式来处理这一任务。本篇将详细讲解基于jQuery的Uploadfy插件的使用方法...

    jQuery权威指南-源代码

    7.10 综合案例分析—使用uploadify插件实现文件上传功能 /232 7.10.1 需求分析/232 7.10.2 效果界面/233 7.10.3 功能实现/234 7.10.4 代码分析/236 7.11 本章小结/241 第8章 jQuery UI插件/242 8.1 认识...

    jQuery权威指南366页完整版pdf和源码打包

    7.9.1 插件的种类 7.9.2 插件开发要点 7.9.3 开发插件示例 7.10 综合案例分析—使用uploadify插件实现文件上传功能 7.10.1 需求分析 7.10.2 效果界面 7.10.3 功能实现 7.10.4 代码分析 7.11 本章小...

Global site tag (gtag.js) - Google Analytics