Advertisement
Guest User

Jquery multiupload init

a guest
Jun 11th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function () {
  2.     'use strict';
  3.  
  4.     // Initialize the jQuery File Upload widget:
  5.     $('#fileupload').fileupload({sequentialUploads : true});
  6.  
  7.     // Load existing files:
  8.     $.getJSON($('#fileupload form').prop('action'), function (files) {
  9.         var fu = $('#fileupload').data('fileupload');
  10.         fu._adjustMaxNumberOfFiles(-files.length);
  11.         fu._renderDownload(files)
  12.             .appendTo($('#fileupload .files'))
  13.             .fadeIn(function () {
  14.                 // Fix for IE7 and lower:
  15.                 $(this).show();
  16.             });
  17.     });
  18.  
  19.     // Open download dialogs via iframes,
  20.     // to prevent aborting current uploads:
  21.     $('#fileupload .files a:not([target^=_blank])').live('click', function (e) {
  22.         e.preventDefault();
  23.         $('<iframe style="display:none;"></iframe>')
  24.             .prop('src', this.href)
  25.             .appendTo('body');
  26.     });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement