Topic: Limit total file upload size

Using Version 2.1.2, Queue Widget.  I need to limit total file upload size to a specified number.  The code below is working to show the Alert when that number is exceeded, but it does add the class to 'disable' the start upload button, and allows the files to be uploaded anyway.  I have found some posts on this topic, but they all seem to refer to an earlier version of Plupload (or something other than the queue widget) and I can't seem to hit the right combination of commands to get to where I need to be.

I'd be very grateful if someone can tell me what I'm overlooking.

// Initialize the widget when the DOM is ready
$(function() {
           var maxQueueSize = 1000000;   
    // Setup html5 version
        var uploader=$("#uploader").pluploadQueue({
        // General settings
        runtimes : 'html5,flash,silverlight,html4',
        url : "upload_files.cfm",
       
        //chunk_size : '1mb',
        rename : true,
        dragdrop: true,
       
        filters : {
            // Maximum file size
            max_file_size : '1mb',
            // Specify what files to browse for
            mime_types: [
                {title : "Image files", extensions : "jpg,gif,png"},
                {title : "Zip files", extensions : "zip"}
            ]
        },
        // Flash settings
        flash_swf_url : '/plupload/js/Moxie.swf',
   
        // Silverlight settings
        silverlight_xap_url : '/plupload/js/Moxie.xap',
       
        init : {
             QueueChanged: function(up) {
                 if(this.total.size > maxQueueSize) {
                 $(".plupload_start").addClass("plupload_disabled");       
                             alert(this.total.size);
                   }
                       }
        }
       
    });
});

Re: Limit total file upload size

You will have to disable the actual picker in addition to visually disabling the picker button. You can do it by calling uploader.disableBrowse().

Btw, check this post for the ways to properly get the reference to uploader object.

If you want to see your issue fixed, do not report it here, do it on - GitHub.