File Upload plugin plupload, upload one, delete before uploading, in order to continue uploading

Source: Internet
Author: User
Tags event listener

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

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.