var uploader = new Plupload. Uploader ({
Runtimes: ' HTML5,FLASH,SILVERLIGHT,HTML4 ',//used to specify the upload method, specify multiple upload methods, please use commas separated.
Browse_button: ' Browse ',//Trigger File Selection Dialog button, for that element ID
Container:container,//is used to specify the parent container for the HTML structure created by Plupload, which defaults to the browse_button
parent element specified earlier. The value of this parameter can be the ID of an element, or it can be the DOM element itself.
Max_file_size: ' 10MB ',//MAX upload file
url:url,//the server side receives and processes the script address of the uploaded file, which can be a relative path (as opposed to the document currently called Plupload) or an absolute path
Flash_swf_url: ' lib/plupload-2.1.2/js/moxie.swf ',
Silverlight_xap_url: ' Lib/plupload-2.1.2/js/moxie.xap ',
Filters: [{
Title: "Image Files",
Extensions: "Jpg,gif,png"
}],
Init: {
triggered when the Init event occurs
Postinit:function () {
},
Bind various events and do what you want to do in the event listener function
filesadded:function (up, files) {
},
triggered when a file in the queue is about to start uploading
Beforeupload:function (up, file) {
},
is triggered during file uploads and can be used to display upload progress
Uploadprogress:function (up, file) {
},
triggered when a file in a queue has been uploaded
Fileuploaded:function (up, file, info) {
if (Info.status = = 200) {
Success
} else if (info.status = = 203) {
Console.log (info);
} else {
Console.log (info);
}
Upload complete Delete picture
Next Click to upload
Uploader.removefile (file);
},
Triggered when an error occurs
Error:function (up, err) {
if (Err.code = =-600) {
} else if (Err.code = =-601) {
} else if (Err.code = =-602) {
} else {
}
}
}
});
Uploader.start ();//Upload
File Upload plugin plupload, upload one, delete before uploading, in order to continue uploading