http://www.cnblogs.com/oec2003/archive/2010/01/06/1640027.htmlhttp://www.it165.net/pro/html/201206/2840.htmlhttp://blog.goyiyo.com/archives/322http://sailing8869.iteye.com/blog/564268以下是可选项的参数说明:(红色的属性代表常用的)1 uploader uploadify.swf文件的相对路径,该swf文件是一个带有文字BROWSE的按钮,点击后淡出打开文件对话框,flash控件默认值=’uploadify.swf’2 script相对路径的后端脚本,它将处理您上传的文件。绝对路径前缀或’/'或’http’的路径默认值=’uploadify.php’3 checkScript检查该文件是否已经选择驻留在服务器上(用来判断上传选择的文件在服务器是否存在的后台处理程序的相对路径)。没有默认值。 官方例子中’check.php’是提供核心文件4 scriptData可提供URL传递参数。用来传递get参数。例如:index.jsp?id=1&action=uploadify可以设置成:‘script’: ‘index.jsp’,‘scriptData’:{‘id’:1,’action’:'uploadify’},注:要设置‘method’:‘GET’.5 fileDataName您的文件在上传服务器脚本阵列的名称。默认值=’Filedata’6 method设置为发送到后端脚本的方法。要么’get’或post’。默认值’post’7 scriptAccessflash脚本文件的访问模式,如果在本地测试设置为always,默认值:sameDomain8 folder您想将文件保存到的路径。考虑到安全问题,一般并不在客户端设定后供服务器得到所存的路径。我试了下。这个参数好像以get的方式传递的。设定post得不到这个值。9 queueID文件队列ID。该ID与存放文件队列的div的ID一致。参考上一篇例子的用法。10 queueSizeLimit限制在一次队列中的次数(可选定几个文件)。默认值= 999,而一次可传几个文件有 simUploadLimit属性决定。11 multi是否允许同时上传多文件,可设定true或false。默认false。设定true时,选中的文件是当前项。12 auto选定文件后是否自动上传,可设定true或false。默认false13 fileDesc出现在上传对话框中的文件类型描述。与fileExt需同时使用14 fileExt支持的格式,启用本项时需同时声明fileDesc。如:‘*.rar;*.doc15 sizeLimit控制上传文件的大小,单位byte16 simUploadLimit多文件上传时,同时上传文件数目限制。默认1一次可传几个文件。17 buttonText默认按钮的名字。默认BROWER18 buttonImg使用图片按钮,设定图片的路径即可。19 hideButton上传按钮的隐藏。true 或false。默认flase20 rollover值为true和false,设置为true时当鼠标移到浏览按钮上时有反转效果。21 width按钮图片的长度。默认 11022 height按钮图片的高度。默认 3023 wmode背景透明transparent 与不透明opaque设定。默认 不透明24 cancelImg取消按钮。设定图片路径。默认cancel.png25 onInit函数, 初始化时的状态。onInit: function() {$(“#id”).html(“上传前”);},26 onComplete函数:可传递五个参数event: 事件对象queueID: 完成文件的唯一标识符。fileObj:• name – 文件名• filepath –上传路径• size – 文件大小• creationDate – 文件创建时间• modificationDate –文件最近修改时间• type –文件的扩展名response: 服务器回调的数据data:• fileCount – The total number of files left in the queue• speed – 平均上传速度 KB/s如:onComplete: function(event, queueID, fileObj) {alert(“文件:” +fileObj.name + “上传失败”); }27 onSelectOnce函数:可传递二个参数event: The event object.data: An object containing details about the select operation.• fileCount – The total number of files in the queue• filesSelected – The number of files selected in the select operation• filesReplaced – The number of files that were replaced in the queue• allBytesTotal – The total number of bytes for all files in the queue28 onCancel函数:可传递四个参数event: The event object.queueID: The unique identifier of the file that was cancelled.fileObj: An object containing details about the file that was selected.• name – The name of the file• size – The size in bytes of the file• creationDate – The date the file was created• modificationDate – The last date the file was modified• type – The file extension beginning with a ‘.’data: Details about the file queue.• fileCount – The total number of files left in the queue• allBytesTotal – The total number of bytes left for all files in the queue29 onClearQueue函数:可传递一个参数event: The event object.30 onQueueFull函数:可传递二个参数• event – The event object.• queueSizeLimit – The maximum size of the queue.31 onError函数:可传递四个参数event: The event object.queueID: The unique identifier of the file that was errored.fileObj: An object containing details about the file that was selected.• name – The name of the file• size – The size in bytes of the file• creationDate – The date the file was created• modificationDate – The last date the file was modified• type – The file extension beginning with a ‘.’errorObj: An object containing details about the error returned.• type – Either ‘HTTP’, ‘IO’, or ‘Security’• info – An error message describing the type of error returned32 onOpen函数:可传递三个参数event: The event object.queueID: The unique identifier of the file that was opened.fileObj: An object containing details about the file that was selected.• name – The name of the file• size – The size in bytes of the file• creationDate – The date the file was created• modificationDate – The last date the file was modified• type – The file extension beginning with a ‘.’33 onProgress函数:可传递四个参数event: The event object.queueID: The unique identifier of the file that was updated.fileObj: An object containing details about the file that was selected.• name – The name of the file• size – The size in bytes of the file• creationDate – The date the file was created• modificationDate – The last date the file was modified• type – The file extension beginning with a ‘.’data: An object containing details about the upload and queue.• percentage – The current percentage completed for the upload• bytesLoaded – The current amount of bytes uploaded• allBytesLoaded – The current amount of bytes loaded for all files in the queue• speed – The current upload speed in KB/s34 onSelectevent: The event object.queueID: The unique identifier of the file that was selected.fileObj: An object containing details about the file that was selected.• name – The name of the file• size – The size in bytes of the file• creationDate – The date the file was created• modificationDate – The last date the file was modified• type – The file extension beginning with a ‘.’35 onAllComplete函数:可传递二个参数event: The event object.data: An object containing details about the upload process.• filesUploaded – The total number of files uploaded• errors – The total number of errors while uploading• allbytesLoaded – The total number of bytes uploaded• speed – The average speed of all uploaded files36 onCheck函数:可传递五个参数event: The event object.checkScript: The path to the file checking script.fileQueue: A file queue object consisting of key/value pairs with the queue ID as the key and the filename as the value.folder: The path to the upload folder.single: True if only one file is being uploaded from the queue.
Jquery Uploadify使用参数详解
最新推荐文章于 2022-03-28 10:44:41 发布