Hey everyone,
Just a quick post detailing how to limit uploadify to a single file. Simply add the following settings to your uploadify initialisation:
multi: false
queueSizeLimit : 1
uploadLimit : 1
$(document).ready(function() { $('#file_upload').uploadify({ 'swf' : 'Html->url('/uploadify/uploadify.swf');?>', 'uploader' : 'Html->url('/uploadify/uploadify.php');?>', 'cancelImg' : 'Html->url('/webroot/uploadify/cancel.png');?>', 'folder' : 'Html->url('/extraz/uploaded_by_all_users');?>', 'auto' : true, 'buttonText' : 'Browse', 'multi' : false, 'queueSizeLimit' : 1, 'uploadLimit' : 1, 'sizeLimit' : 1073741824, 'debug' : true, 'multi' : false, 'onUploadProgress' : upload_progress_handler, 'onUploadStart' : upload_start_handler, 'onUploadSuccess' : on_upload_success, 'onUploadError' : on_upload_error }); });
Once the upload limit is exceeded the onUploadError event is raised.
Cheers
Leave a Reply