Search code examples
limitswfupload

swfupload limit the number of uploaded files


Is there anyway to limit the number of uploaded files in swfupload ? If there is no such setting in swfupload how can I check that number ?

Thanks


Solution

  • You can restrict the number of uploaded files using 'file_upload_limit' property in the setting object. eg:

    var swfu = new SWFUpload({
        upload_url : "http://www.swfupload.org/upload.php",
        flash_url : "http://www.swfupload.org/swfupload.swf",
        file_upload_limit: "10" // limit uploads to 10 files
    });
    

    You can use setFileUploadLimit(file_upload_limit) method to dynamically modify this setting.