文件上传组件 Uploadify (可批量上传)

帮助文档:http://www.uploadify.com/documentation/

常用参数:

auto (是否自动上传)

Boolean

true

Set to false if you do not want the files to automatically upload when they are added to the queue.  If set to false, the upload can be triggered using the upload method.

Demo

Javascript Code
1
2
3
4
5
6
7
$(function(){
    $("#file_upload").uploadify({
        'auto'     :false,
        'swf'      :'/uploadify/uploadify.swf',
        'uploader':'/uploadify/uploadify.php'
    });
});

 

 

buttonClass (应用在按钮上的样式)

String

(Empty String)

Yes

A class name to add to the Uploadify button.

buttonText (按钮上的文字)

String

'SELECT FILES'

The text that will appear on the browse button.  This text is rendered as HTML and may include HTML entities.

fileSizeLimit (上传文件大小,0为不限制大小)

Number

The maximum size allowed for a file upload.  This value can be a number or string.  If it’s a string, it accepts a unit (B, KB, MB, or GB).  The default unit is in KB.  You can set this value to 0 for no limit.

fileTypeExts (可上传的文件类型)

String

'*.*'

A list of allowable extensions that can be uploaded.  A manually typed in file name can bypass this level of security so you should always check file types in your server-side script.  Multiple extensions should be separated by semi-colons (i.e. ‘*.jpg; *.png; *.gif’).

formData (附加参数,传递到上传处理页)

JSON Object

Empty Object

An object containing additional data to send via get or post with each file upload.  If you plan on setting these values dynamically, this should be done using the ‘settings’ method in the onUploadStart event.  You can access these values in the server-side script using the $_GET or $_POST arrays (PHP).

height (按钮高度)

Number

30

The height of the button in pixels.

width(按钮宽度)

Number

120

The width of the browse button in pixels.  Do not include ‘px’ in the value as this should only be an integer.

multi (是否可以多选)

Boolean

true

Set to false to allow only one file selection at a time.

uploadLimit (可以上传多少个文件)

Number

999

The maximum number of files you are allowed to upload.  When this number is reached or exceeded, the onUploadError event is triggered.

uploader (处理上传的文件)

String

'uploadify.php'

Yes

The path to the server-side upload script (uploadify.php).  This should be a path that is relative to the root is possible to avoid issues, but it will also accept a path that is relative to the current script.  For more information about setting up a custom server-side upload script, see our article on Setting Up a Custom Server-Side Upload Script.

swf (uploadify.swf file路径)

String

'uploadify.swf'

Yes

The path to the uploadify.swf file.  This path should be relative to the root if possible to avoid issues, but will also accept paths relative to the current script.

 

 

 

 

 

 

 

 

 

posted on 2012-11-05 11:11  woshilee  阅读(1524)  评论(0)    收藏  举报

导航