Uploadify Upload Plugin parameter description

Source: Internet
Author: User
Tags file upload

Example

The code is as follows Copy Code

_this.uploadify ({


HEIGHT:20,//button height


width:75,//button width


SWF: '/js/uploadify/uploadify.swf ') ',//Flash location


FormData: {' Phoneno ': 10},//Extra parameters


Uploader: '/uploadify/',//upload file Server storage location


filesizelimit:2048,//upload file limit size


Filetypeexts: ' *.gif;*.jpg;*.png;*.jpeg ',//allow uploading of file types; Allow arbitrary files to be uploaded by default


Multi:false,//whether to support multiple file upload; True/false (yes/No)


Onuploadstart:function () {//Upload start trigger Event


_this.find (". Uploadify-button-text:eq (" + j + ")"). html ("Upload ...");


},


Onuploadsuccess:function (file, MSG, response) {//Upload successful trigger event


msg = $.parsejson (msg);


_this.find (". Uploadify-button-text:eq (" + j + ")"). HTML ("uploaded");


},


Onuploaderror:function (file,errorcode,erormsg,errorstring) {//Upload error trigger Event


Alert ("File upload error" +errorstring);


}


});

Ps:flash cannot cross Domain

A more detailed parameter table is attached below

1

Uploader

Upload control's principal file, Flash control

default = ' uploadify.swf '

2

Script

The back-end script for the relative path, which will process the file you uploaded.

Absolute path prefix or path of '/' or ' http '

default = ' uploadify.php '

3

Checkscript

Check to see if the file has been selected to reside on the server.
There is no default value. The official example of ' check.php ' is to provide the core document

4

Scriptdata

You can provide URL pass parameters. Used to pass a get parameter. For example:

index.jsp?id=1&action=uploadify can be set to:

' Script ': ' index.jsp ',

' Scriptdata ': {' id ': 1, ' action ': ' Uploadify '},

Note: To set ' method ': ' Get '.

5

Filedataname

The name of your file in the Upload server script array.
default = ' filedata '

6

Method

set to the method that is sent to the backend script. Either ' get ' or post '.

default value ' post '

7

Scriptaccess

?

8

Folder

The path to which you want to save the file. Given security concerns, it is not generally available for the server to get the saved path after the client is set up. I tried it. This parameter seems to be passed in the form of get. The set post does not have this value.

9

Queueid

file Queue ID. Consistent with the Div ID. Refer to the use of the previous example.

10

Queuesizelimit

The number of times a queue is restricted (several files can be selected). The default value = 999, and a few files can be passed a simuploadlimit Property decision .

11

Multi

Whether to allow multiple files to be uploaded simultaneously can be set to TRUE or false.

default False. When set to True, the selected file is the current item.

12

Auto

Set true or False if the file is automatically uploaded after you select it.

Default False

13

Filedesc

The file type description that appears in the Upload dialog box. and fileext need to be used simultaneously

14

Fileext

Supported formats, you must declare FILEDESC when you enable this item.

such as: ' *.rar,*.doc

15

SizeLimit

Control the size of the uploaded file, unit byte

16

Simuploadlimit

Multiple file uploads, while uploading the number of files limit. Default 1

You can pass several files at a time.

17

ButtonText

The name of the default button. Default Brower

18

Buttonimg

Use the Picture button to set the path to the picture.

19

Hidebutton

The Upload button is hidden. True or FALSE. Default Flase

20

Rollover

?

21st

Width

The length of the button picture. Default 110

22

Height

The height of the button picture. Default 30

23

Wmode

background transparent transparent with opaque opaque settings. Default Opacity

24

Cancelimg

Cancel the button. Set the picture path. Default Cancel.png

25

OnInit

function, the state at which it is initialized.

Oninit:function () {

$ ("#id"). HTML ("before uploading");

26

OnComplete

Function: can pass five parameters

Event : Events Object

Queueid : A unique identifier for the completed file.

Fileobj :

name – file name

filepath -upload path

size – File sizes

creationdate – File creation time

modificationdate – File Recent modification time

type – file name extension

Response : data for server callbacks

Data :

filecount –the Total number of files left in the queue

speed – Average upload speed kb/s

Such as:

oncomplete: Function (event, Queueid, Fileobj) {

Alert ("File:" +fileobj.name + "upload failed");  }

Onselectonce

 

function: Can pass two parameters

event : the event object.

data : An object containing details about the Select Operation.

  • filecount –the Total number of files in the queue

  • Filessel ected –the number of files selected in the Select Operation

  • filesreplaced –the number of files that were replaced in the queue

  • allbytestotal –the Total Numb Er of bytes for all files in the queue

 

28

OnCancel

Function: can pass four parameters

Event : The event object.

Queueid : The unique identifier of the file that is cancelled.

Fileobj : An object containing details about the file this 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 is 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 to all files in the queue

29

Onclearqueue

Function: can pass a parameter

Event : The event object.

30

Onqueuefull

Function: can pass two parameters

Event -the event object.

Queuesizelimit -The maximum size of the queue.

31

OnError

Function: can pass four parameters

Event: The Event object.

Queueid : The unique identifier of the file that is errored.

Fileobj : An object containing details about the file this 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 is 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 returned

onopen< /strong>

 

function: Pass three parameters

event : the event object.

Queueid : The unique identifier of the file that is opened.

fileobj : An object containing details about the file this was selected.

  • name –the name of the file

  • size –the size in byt Es of the file

    creationdate –the date The file was created

 < wbr> modificationdate –the Last date the file is modified

  • type –the file extension beginning with a '. '

 

33

OnProgress

Function: can pass four parameters

Event : The event object.

Queueid : The unique identifier of the file that is updated.

Fileobj : An object containing details about the file this 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 is 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 to all files in the queue

speed –the upload speed in kb/s

%

Onselect

 

 

Event : the event object.

Queueid : The unique identifier of the file that is selected.

fileobj : An object containing details about the file this was selected.

  • name –the name of the file

  • size –the size in byt Es of the file

  • creationdate –the date The file was created

  modificationdate –the Last date the file is modified

  • type –the file Extension beginning with a '. '

&NBSP;

$

Onallcomplete

 

 

function: Can pass two parameters

 

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 Numb Er of bytes uploaded

  • speed –the average speed of all uploaded files

 

36

Oncheck

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.