Web File Upload Module plupload

Source: Internet
Author: User

Plupload is an interface-friendly file upload module on a Web browser that displays upload progress, image Auto-thumbnails, and upload tiles. Multiple files can be uploaded at the same time.

Example code:

<!-- Load Queue widget CSS and jQuery --> < style type = "text/css" >@import url(css/plupload.queue.css);</ style > < script type = "text/javascript" src = "http://www.google.com/jsapi" ></ script > < script type = "text/javascript" >      google.load("jquery", "1.3"); </ script > <!-- Thirdparty intialization scripts, needed for the Google Gears and BrowserPlus runtimes --> < script type = "text/javascript" src = "/plupload/js/gears_init.js" ></ script > < script type = "text/javascript" src = "http://bp.yahooapis.com/2.4.21/browserplus-min.js" ></ script > <!-- Load plupload and all it‘s runtimes and finally the jQuery queue widget --> < script type = "text/javascript" src = "/plupload/js/plupload.full.min.js" ></ script > < script type = "text/javascript" src = "/plupload/js/jquery.plupload.queue.min.js" ></ script > < script type = "text/javascript" > // Convert divs to queue widgets when the DOM is ready $().ready(function() {      $("#uploader").pluploadQueue({          // General settings          runtimes : ‘gears,flash,silverlight,browserplus,html5‘,          url : ‘upload.php‘,          max_file_size : ‘10mb‘,          chunk_size : ‘1mb‘,          unique_names : true,          // Resize images on clientside if we can          resize : {width : 320, height : 240, quality : 90},          // Specify what files to browse for          filters : [              {title : "Image files", extensions : "jpg,gif,png"},              {title : "Zip files", extensions : "zip"}          ],          // Flash settings          flash_swf_url : ‘/plupload/js/plupload.flash.swf‘,          // Silverlight settings          silverlight_xap_url : ‘/plupload/js/plupload.silverlight.xap‘      });      // Client side form validation      $(‘form‘).submit(function(e) {          var uploader = $(‘#uploader‘).pluploadQueue();          // Validate number of uploaded files          if (uploader.total.uploaded == 0) {              // Files in queue upload them first              if (uploader.files.length > 0) {                  // When all files are uploaded submit form                  uploader.bind(‘UploadProgress‘, function() {                      if (uploader.total.uploaded == uploader.files.length)                          $(‘form‘).submit();                  });                  uploader.start();              } else                  alert(‘You must at least upload one file.‘);              e.preventDefault();          }      }); }); </ script > ... < form ..>      < div id = "uploader" >          < p >You browser doesn‘t have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</ p >      </ div > </ form >

Web File Upload Module plupload

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.