Plupload two ways to upload plug-in binding events

Source: Internet
Author: User

After a day's ordeal, I finally found a way to handle the event:

First quote:

<script src= "Js/plupload.full.min.js" type= "Text/javascript" ></script><!--must be introduced--
<script src= "Js/i18n/zh_cn.js" type= "Text/javascript" ></script><!--display Chinese--

First: Generate this plugin directly in the tag

$ ("#uploader"). Plupload ({
Runtimes: ' GEARS,FLASH,SILVERLIGHT,BROWSERPLUS,HTML5 ',
URL: ' uploadfiles.ashx ',//server upload Path
Max_file_size: ' 500MB ',//File upload maximum limit.
Chunk_size: ' 1MB ',//upload the size of each block, this value is less than the maximum upload limit value of the server.
Unique_names:true,//upload file name is unique

Initialize the plugin directly in the tag, and start
Init: {


Queuechanged:function (UP)

{

This is a file list change event; write event handling methods;

},//Initialize the plugin directly in the tag, end
Whether to generate thumbnails (only valid for picture files)
Resize: {width:320, height:240, quality:90},
This array is the selector, which is the limit upload file type when uploading the file
Filters: [{title: "All Files", Extensions: "Mp3,s48"}
],

The path where the Flash file is located
Flash_swf_url: '/js/moxie.swf ',
The path where the Silverlight file resides
Silverlight_xap_url: '/js/moxie.xap '
});

The second method:

<script>    //Instantiate a Plupload upload object    var uploader = new Plupload. Uploader ({        Browse_button: ' Browse ',//Trigger File Selection Dialog button, for that element ID        URL: ' upload.php ',//server-side upload page address        flash_swf_ URL: ' js/moxie.swf ',//swf file, you need to configure this parameter when uploading using SWF        silverlight_xap_url: ' js/moxie.xap '//silverlight file, You need to configure this parameter when you need to upload using silverlight mode    });        The init () method is called on the instance object to initialize the    uploader.init ();   //Bind various events and do what you want to do in the event listener    uploader.bind (' filesadded ', function (uploader,files) {        // Each event listener function will pass in some useful parameters,        //We can use the information provided by these parameters to do such things as updating the UI, prompting the upload progress, etc.    });    Uploader.bind (' uploadprogress ', function (uploader,file) {        ///each event listener function will pass some useful arguments,        // We can use the information provided by these parameters to do such things as updating the UI, prompting the upload progress, etc.    });

It is important to note that events can only be bound after initialization;

The reference connection is given below

Http://www.cnblogs.com/2050/p/3913184.html#plupload_doc4

Http://www.vkilo.com/plupload.html

Plupload two ways to upload plug-in binding events

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.