`

Jquery uploadify插件可选参数的详细介绍

 
阅读更多

以下是可选项的参数说明:(红色的属性代表常用的)

<wbr></wbr>

1

uploader

上传控件的主体文件,flash控件

<wbr><wbr> 默认值='uploadify.swf'</wbr></wbr>

2

script

<wbr></wbr>

相对路径的后端脚本,它将处理您上传的文件。

绝对路径前缀或'/'或'http'的路径

<wbr> 默认值='uploadify.php'</wbr>

3

checkScript

<wbr></wbr>

检查该文件是否已经选择驻留在服务器上。
没有默认值。 官方例子中'check.php'是提供核心文件

4

scriptData

<wbr></wbr>

可提供URL传递参数。用来传递get参数。例如:

<wbr> index.jsp?id=1&amp;action=uploadify可以设置成:</wbr>

'script': 'index.jsp',

'scriptData':{'id':1,'action':'uploadify'},

注:要设置‘method’:‘GET’.

<wbr></wbr>

5

fileDataName

<wbr></wbr>

<wbr>您的文件在上传服务器脚本阵列的名称。<br><wbr><wbr> 默认值='Filedata'</wbr></wbr></wbr>

6

method

<wbr></wbr>

<wbr>设置为发送到后端脚本的方法。要么'get'或post'。</wbr>

<wbr><wbr> 默认值'post'</wbr></wbr>

7

scriptAccess

<wbr></wbr>

<wbr>?</wbr>

8

folder

<wbr></wbr>

您想将文件保存到的路径。考虑到安全问题,一般并不在客户端设定后供服务器得到所存的路径。我试了下。这个参数好像以get的方式传递的。设定post得不到这个值。

9

queueID

<wbr></wbr>

<wbr>文件队列ID。与div的id一致。</wbr>

10

queueSizeLimit

<wbr></wbr>

限制在一次队列中的次数(可选定几个文件)。默认值= 999,而一次可传几个文件有 simUploadLimit属性决定

11

multi

<wbr></wbr>

是否允许同时上传多文件,可设定true或false。

<wbr> 默认false。设定true时,选中的文件是当前项。</wbr>

12

auto

<wbr></wbr>

选定文件后是否自动上传,可设定true或false。

<wbr> 默认false</wbr>

13

fileDesc

<wbr></wbr>

出现在上传对话框中的文件类型描述。与fileExt需同时使用

14

fileExt

<wbr></wbr>

支持的格式,启用本项时需同时声明fileDesc。

如:‘*.rar,*.doc

<wbr></wbr>

15

sizeLimit

<wbr></wbr>

控制上传文件的大小,单位byte

16

simUploadLimit

<wbr></wbr>

多文件上传时,同时上传文件数目限制。默认1

<wbr> 一次可传几个文件。</wbr>

17

buttonText

<wbr></wbr>

默认按钮的名字。默认BROWER

18

buttonImg

<wbr></wbr>

使用图片按钮,设定图片的路径即可。

19

hideButton

<wbr></wbr>

上传按钮的隐藏。true 或false。默认flase

20

rollover

<wbr></wbr>

<wbr>?</wbr>

21

width

<wbr></wbr>

<wbr>按钮图片的长度。默认 110</wbr>

22

height

<wbr></wbr>

<wbr>按钮图片的高度。默认 30</wbr>

23

wmode

<wbr></wbr>

<wbr>背景透明transparent 与不透明opaque设定。默认 不透明</wbr>

<wbr></wbr>

24

cancelImg

<wbr></wbr>

<wbr>取消按钮。设定图片路径。默认cancel.png</wbr>

<wbr></wbr>

<wbr></wbr>

25

onInit

<wbr></wbr>

函数, 初始化时的状态。

onInit: function() {<wbr></wbr>

$("#id").html("上传前");},

26

onComplete

<wbr></wbr>

函数:可传递五个参数

event: 事件对象

queueID: 完成文件的唯一标识符。

fileObj: <wbr></wbr>

<wbr> • <strong>name</strong> – 文件名</wbr>

<wbr> • <strong>filepath</strong> –上传路径</wbr>

<wbr> • <strong>size</strong> – 文件大小</wbr>

<wbr> • <strong>creationDate</strong> – 文件创建时间</wbr>

<wbr> • <strong>modificationDate</strong> –<a name="OLE_LINK9"></a><a name="OLE_LINK8">文件最近修改时间</a></wbr>

<wbr> • <strong>type</strong> –文件的扩展名</wbr>

response: 服务器回调的数据

data: <wbr></wbr>

<wbr> • <strong>fileCount</strong> – The total number of files left in the queue</wbr>

<wbr> • <strong>speed</strong> – 平均上传速度 KB/s</wbr>

如:

onComplete: function(event, queueID, fileObj) {

<wbr> alert("文件:" +fileObj.name + "上传失败");<wbr><wbr>}</wbr></wbr></wbr>

<wbr></wbr>

27

onSelectOnce

<wbr></wbr>

函数:可传递二个参数

event: The event object.

data: An object containing details about the select operation.

<wbr> • <strong>fileCount</strong> – The total number of files in the queue</wbr>

<wbr> • <strong>filesSelected</strong> – The number of files selected in the select operation</wbr>

<wbr> • <strong>filesReplaced</strong> – The number of files that were replaced in the queue</wbr>

<wbr> • <strong>allBytesTotal</strong> – The total number of bytes for all files in the queue</wbr>

<wbr></wbr>

28

onCancel

<wbr></wbr>

函数:可传递四个参数

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.

<wbr><wbr> • <strong>name</strong> – The name of the file</wbr></wbr>

<wbr><wbr> • <strong>size</strong> – The size in bytes of the file</wbr></wbr>

<wbr><wbr> • <strong>creationDate</strong> – The date the file was created</wbr></wbr>

<wbr><wbr> • <strong>modificationDate</strong> – The last date the file was modified</wbr></wbr>

<wbr><wbr> • <strong>type</strong> – The file extension beginning with a '.'</wbr></wbr>

<wbr></wbr>

data: Details about the file queue.

<wbr><wbr> • <strong>fileCount</strong> – The total number of files left in the queue</wbr></wbr>

<wbr><wbr> • <strong>allBytesTotal</strong> – The total number of bytes left for all files in the queue</wbr></wbr>

<wbr></wbr>

29

onClearQueue

<wbr></wbr>

函数:可传递一个参数

event: The event object.

30

onQueueFull

<wbr></wbr>

函数:可传递二个参数

event - The event object.

queueSizeLimit - The maximum size of the queue.

<wbr></wbr>

31

onError

<wbr></wbr>

函数:可传递四个参数

<wbr></wbr>

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.

<wbr> • <strong>name</strong> – The name of the file</wbr>

<wbr> • <strong>size</strong> – The size in bytes of the file</wbr>

<wbr> • <strong>creationDate</strong> – The date the file was created</wbr>

<wbr> • <strong>modificationDate</strong> – The last date the file was modified</wbr>

<wbr><strong>• type</strong> – The file extension beginning with a '.'</wbr>

errorObj: An object containing details about the error returned.

<wbr><strong>• type</strong> – Either 'HTTP', 'IO', or 'Security'</wbr>

<wbr><strong>• info</strong> – An error message describing the type of error returned</wbr>

<wbr></wbr>

32

onOpen

<wbr></wbr>

函数:可传递三个参数

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.

<wbr> • <strong>name</strong> – The name of the file</wbr>

<wbr> • <strong>size</strong> – The size in bytes of the file</wbr>

<wbr> •<wbr><strong>creationDate</strong> – The date the file was created</wbr></wbr>

<wbr> • <strong>modificationDate</strong> – The last date the file was modified</wbr>

<wbr> • <strong>type</strong> – The file extension beginning with a '.'</wbr>

<wbr></wbr>

33

onProgress

<wbr></wbr>

<wbr></wbr>

函数:可传递四个参数

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.

<wbr> • <strong>name</strong> – The name of the file</wbr>

<wbr> • <strong>size</strong> – The size in bytes of the file</wbr>

<wbr> • <strong>creationDate</strong> – The date the file was created</wbr>

<wbr> • <strong>modificationDate</strong> – The last date the file was modified</wbr>

<wbr> • <strong>type</strong> – The file extension beginning with a '.'</wbr>

<wbr></wbr>

data: An object containing details about the upload and queue.

<wbr> • <strong>percentage</strong> – The current percentage completed for the upload</wbr>

<wbr> • <strong>bytesLoaded</strong> – The current amount of bytes uploaded</wbr>

<wbr> • <strong>allBytesLoaded</strong> – The current amount of bytes loaded for all files in the queue</wbr>

<wbr> • <strong>speed</strong> – The current upload speed in KB/s</wbr>

<wbr></wbr>

34

onSelect

<wbr></wbr>

<wbr></wbr>

event: The event object.

queueID: The unique identifier of the file that was selected.

fileObj: An object containing details about the file that was selected.

<wbr> • <strong>name</strong> – The name of the file</wbr>

<wbr> • <strong>size</strong> – The size in bytes of the file</wbr>

<wbr> • <strong>creationDate</strong> – The date the file was created</wbr>

<wbr> • <strong>modificationDate</strong> – The last date the file was modified</wbr>

<wbr> • <strong>type</strong> – The file extension beginning with a '.'</wbr>

<wbr></wbr>

35

onAllComplete

<wbr></wbr>

<wbr></wbr>

函数:可传递二个参数

<wbr></wbr>

event: The event object.

data: An object containing details about the upload process.

<wbr> • <strong>filesUploaded</strong> – The total number of files uploaded</wbr>

<wbr> • <strong>errors</strong> – The total number of errors while uploading</wbr>

<wbr> • <strong>allbytesLoaded</strong> – The total number of bytes uploaded</wbr>

<wbr> • <strong>speed</strong> – The average speed of all uploaded files</wbr>

<wbr></wbr>

36

onCheck

<wbr></wbr>

函数:可传递五个参数

<wbr></wbr>

event: The event object.

checkScript: The path to the file checking script.

fileQueue: A file queue object consisting of<wbr> key/value pairs with the queue ID as the key and the filename as the value.</wbr>

folder: The path to the upload folder.

single: True if only one file is being uploaded from the queue.

分享到:
评论

相关推荐

    jquery uploadify上传多附件示例

    `fileTypeDesc`和`fileTypeExts`用于限制可选文件类型。`queueSizeLimit`和`simUploadLimit`控制了上传队列的最大数量和同时上传的数量。`auto`参数设定是否自动上传,而`onQueueFull`和`onUploadSuccess`则是自定义...

    jquery uploadify 实现批量上传,带进度显示,判断文件大小

    下面将详细介绍这个插件的使用和相关知识点。 ### 1. jQuery Uploadify简介 `jQuery Uploadify`是一个开源的文件上传组件,它通过异步方式实现多文件上传,提高了用户体验。它支持预览、取消上传、限制文件类型和...

    使用jquery的uploadify插件实现文件上传

    在Web开发中,文件上传是一项常见的需求,而jQuery的uploadify插件则为开发者提供了一个简单易用的解决方案。Uploadify是一款基于JavaScript和Flash的文件上传组件,它能够优雅地处理多文件上传,并且提供了丰富的...

    php的jquery.uploadify文件上传例子

    'queueID': 'fileQueue', // 队列容器ID(可选) 'onUploadSuccess': function(file, data, response) { console.log('文件' + file.name + '上传成功,响应码:' + response); }, 'onUploadError': function...

    上传图片问题(html标签实现input/file功能),及uploadify插件

    本篇将详细介绍如何在非`&lt;input&gt;`标签(如`&lt;span&gt;`)上模拟`&lt;input type="file"&gt;`的功能,并探讨uploadify插件的使用,以提升用户体验。 首先,让我们来看看如何在`&lt;span&gt;`标签上实现文件选择功能。通常,我们会将`...

    jQuery-Uploadify详解.pdf

    - **功能描述**:设置文件上传时显示的数据类型,可选“speed”(上传速度)或“percentage”(百分比)。 #### queueID - **功能描述**:标识上传队列的DOM元素ID,用于显示上传队列的情况。 #### ...

    优秀的Jquery插件集合

    本文将详细介绍几个优秀的jQuery插件,这些插件能够显著提高页面效果的实现效率,为Web项目带来更加流畅和互动的体验。 #### jQuery核心库:一切的基础 jQuery的核心库是整个框架的基石,它提供了诸如选择元素、...

    uploadify 中文API

    通过以上步骤,我们可以顺利地在网站中集成Uploadify插件来实现文件上传功能。需要注意的是,在实际开发过程中,还需要根据具体的应用场景对上传的文件进行更严格的验证,比如文件大小限制、文件类型限制等,以保证...

    jQuery文件上传插件Uploadify使用指南

    还可以对Uploadify插件进行更多详细配置,包括但不限于以下参数: - `uploader`:Flash文件上传控件的相对路径,默认为`uploadify.swf`。 - `script`:后端处理上传文件的脚本路径,默认为`uploadify.php`。 - `...

    一个jquery 的多文件上传示例

    上述代码中,`swf`指定了Flash组件的位置,`uploader`是服务器端处理上传的URL,`fileTypeDesc`和`fileTypeExts`限制了可选文件类型,`multi`和`auto`分别设置为true表示支持多文件上传和自动上传。`onUploadSuccess...

    asp.net 写的一个二维码生成应用 ,可自定义大小,可选中心图, 页面用到了jquery-ui

    此外,该项目还利用了jQuery.uploadify插件来实现文件上传功能,增加了项目的实用性和多样性。 1. **ASP.NET框架** ASP.NET是微软开发的一种服务器端Web应用程序框架,用于构建动态网站、Web应用和服务。在这个...

    uploadify-2.1.4多文件上传组件的使用说明整理

    本文将详细介绍Uploadify 2.1.4的使用方法及其核心特点。 一、安装与配置 首先,你需要在项目中引入jQuery库和Uploadify的JavaScript及CSS文件。通常,这些文件会包含在`vinUploadifyTest`压缩包内。将它们放在...

    关于uploadify的使用和示例

    - **buttonCursor**:字符串,设定按钮鼠标悬停时的光标样式,可选`'hand'`或`'arrow'`。 - **buttonImage**:字符串,设置按钮的背景图片路径。 - **buttonText**:字符串,设置按钮的文字内容。 除此之外,还有`...

    java使用uploadify批量上传文件

    'queueID': 'fileQueue', // 可选,队列ID 'fileTypeDesc': '所有文件', 'fileTypeExts': '*.*', 'multi': true, // 开启批量上传 'onUploadSuccess': function (file, data, response) { console.log('文件' ...

    jQuery文件上传控件 Uploadify 详解

    Uploadify 是一个基于 jQuery 的文件上传插件,它支持 AJAX 无刷新上传、多文件同时上传以及上传进度显示,能够显著提升用户在网页上进行文件上传的体验。要使用 Uploadify,你需要确保环境满足以下条件:jQuery ...

    uploadify多文件上传

    总的来说,Uploadify是一个强大的多文件上传工具,它提供了丰富的功能和高度的可定制性,能够帮助开发者轻松地在网页上实现高效、友好的文件上传功能。通过深入理解和灵活运用,我们可以为用户创造更出色的文件上传...

    关于jq图片上传的插件

    首先,`uploadify.zip` 可能包含的是Uploadify插件。Uploadify是一款基于jQuery的文件上传插件,它提供了异步、批量和多文件上传的功能。通过AJAX技术,用户可以选择多个文件并一次性上传,无需刷新页面,提高了上传...

Global site tag (gtag.js) - Google Analytics