1

I have an upload page on my site where a user will need to upload files for a large number of records (100+), and am using Uploadify v3 to initialize the upload buttons for each record, using this:

$(".uploadPDF").each(function(){                            
    var eid = $(this).attr('data-eid');
    $(this).uploadify({
        'swf' : '/assets/js/uploadify/uploadify.swf',
        'uploader' : '/fileops/upload_file',
        'buttonText' : 'Select file',
        'auto' : true,
        'formData' : {
            'eid':eid
                },
        'onUploadSuccess' : function(file, data, response) {
        }   
    });
}); //end each

However, this function takes ~20 seconds per 100 entries to initialize. Using Firebug, it seems that the biggest culprit is the call to uploadify.swf.

Is there a way to take care of this and speed it up? Or should I just not be initializing that many instances at once? If so, what would be a way around this?

Thanks!

skiindude22
  • 509
  • 5
  • 22
  • In my opinion you shouldn't initialize Uploadify more than once on a page. Instead, let the user select multiple files at once so Uploadify can make use of its neat upload queue... – Aletheios Oct 30 '12 at 21:38
  • The user needs to attach certain files with certain records, it is not just a batch upload, so the queue is not what I'm looking for. – skiindude22 Oct 30 '12 at 21:40
  • You shouldn't use Uploadify then. As their website says, it's a "Multiple File Upload Plugin". ;) You could use an easier solution without Flash. Maybe this helps: http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery – Aletheios Oct 30 '12 at 21:45
  • I'm open to trying something else if there is something better, but I need the uploading progress bar and was hoping to eventually take advantage of Uploadifive's drag and drop uploading and several other features. – skiindude22 Oct 30 '12 at 21:53

0 Answers0