Usage:
// The bound Interface Element <input id =' Gallery 'Type = 'file'/>
$ ("# Gallery"). uploadify ({
Set parameters as follows.
});
Set attributes:
ID: jquery (this). ATTR ('id '), // ID of the bound Input
Langfile :' Http://www.static-xxx.nu/uploader/uploadifylang_en.js ', // Language package path. All prompt text can be set.
SWF :' Http://www.static-xxx.nu/uploader/uploadify.swf ', // [Required] SWF path
Uploader: '/uploadify/galleri. php ', // [Required] URL triggered by File Upload
Auto: false, // Whether to upload files automatically after the file is selected
Buttontext: 'välj filer ', // Text of the upload button
Height: 30, // Upload Button height and width
Width: 120,
Buttoncursor: 'pointer ', // Upload After hover Cursor Shape
Cancelimage :' Http://www.static-xxx.nu/uploadify-cancel.png ', // [Required] Cancel image path
Checkexisting: '/Uploader/uploadify-check-existing.php ', // Check whether the uploaded file is saved. The triggered URL returns 1/0
Debug: True, // Enable/disable in debug mode. The debug information is displayed.
Fileobjname: 'file ',
Filesizelimit: 0, // maximum file size, in bytes, 0 is not limited. 1 MB: 1*1024*1024
Filetypedesc: 'bild JPG ', // description of the file type that can be uploaded, which is displayed in the pop-up file selection box.
Filetypeexts: '*. jpg ', // Specifies the types of files that can be uploaded, and specifies the files that can be selected in the pop-up object selection box.
Method: 'post ', // Interaction with the background: Post/get
Multi: True, // Select multiple files
Queueid: 'filequeue ', // Display Element ID, you can simply use a div To display
Queuesizelimit: 999, // Maximum number of files allowed in the queue
Progressdata: 'all', // 'percentage' 'speed' 'All' // How to display the File Upload progress in the queue: All-upload speed + percentage, Percentage-percentage, Speed-upload speed
Removecompleted: True, // Whether the uploaded files are automatically deleted in the queue
Removetimeout: 3,
Requeueerrors: True,
Postdata :{}, // Additional parameters when interacting with the background
Preventcaching: True,
Transparent: True,
Successtimeout: 30, // Timeout during upload
Uploadlimit: 999 // Number of files that can be uploaded simultaneously
Set events:
Ondialogclose: function (swfuploadifyqueue ){//Triggered when the file selection dialog box is closed
If (swfuploadifyqueue. fileserrored> 0 ){
Alert ('when added to the queue'
+ Swfuploadifyqueue. fileserrored
+ 'File errors N'
+ 'Error message :'
+ Swfuploadifyqueue. errormsg
+ 'N' number of selected files :'
+ Swfuploadifyqueue. filesselected
+ 'N' number of files successfully added to the queue :'
+ Swfuploadifyqueue. filesqueued
+ 'N' total number of files in the queue :'
+ Swfuploadifyqueue. queuelength );
}
}
Ondialogopen: function (){//Triggered when the select file dialog box is opened
Alert ('Open! ');
}
Onselect: function (File ){//Triggered when each file is added to the queue
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus );
}
Onselecterror: function (file, errorcode, errormsg ){//Triggered when an error occurs during file selection
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus
+ '-ErrorCode: '+ Errorcode
+ '-Error message:' + errormsg );
}
Onqueuecomplete: function (Stats ){//Triggered when all files in the queue are uploaded
Alert ('number of successfully uploaded files: '+ stats. successful_uploads
+ '-Number of files with an upload error:' + stats. upload_errors
+ '-Number of unuploaded files:' + stats. upload_cancelled
+ '-Number of files in error' + stats. queue_errors );
}
Onuploadcomplete: function (file, swfuploadifyqueue ){//Triggered once when each file in the queue is uploaded
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus
+ '-Number of failed files:' + swfuploadifyqueue. fileserrored
+ '-Error message:' + swfuploadifyqueue. errormsg
+ '-Number of queues to be added:' + swfuploadifyqueue. filesselected
+ '-Number of opposites added:' + swfuploadifyqueue. filesqueued
+ '-Queue length:' + swfuploadifyqueue. queuelength );
}
Onuploaderror: function (file, errorcode, errormsg, errorstring, swfuploadifyqueue ){//An error occurs when a file is uploaded (trigger once for each file with an error)
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus
+ '-Error code:' + errorcode
+ '-Error Description:' + errormsg
+ '-Brief error Description:' + errorstring
+ '-Number of failed files:' + swfuploadifyqueue. fileserrored
+ '-Error message:' + swfuploadifyqueue. errormsg
+ '-Number of queues to be added:' + swfuploadifyqueue. filesselected
+ '-Number of opposites added:' + swfuploadifyqueue. filesqueued
+ '-Queue length:' + swfuploadifyqueue. queuelength );
}
Onuploadprogress: function (file, filebytesloaded, filetotalbytes,
Queuebytesloaded, swfuploadifyqueueuploadsize ){//Triggered when the upload progress changes
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus
+ '-The current file has been uploaded:' + filebytesloaded
+ '-Current file size:' + filetotalbytes
+ '-The queue has been uploaded:' + queuebytesloaded
+ '-Queue size:' + swfuploadifyqueueuploadsize );
}
Onuploadstart: function (File ){//Triggered when the upload starts (each file is triggered once)
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus );
}
Onuploadsuccess: function (file, Data, response ){//Triggered when the upload is complete (each file is triggered once)
Alert ('Id: '+ file. ID
+ '-Index:' + file. Index
+ '-File Name:' + file. Name
+ '-File size:' + file. Size
+ '-Type:' + file. Type
+ '-Creation date:' + file. creationdate
+ '-Modification date:' + file. modificationdate
+ '-File status:' + file. filestatus
+ '-Server-side message:' + Data
+ '-Whether the upload is successful:' + response );
}