Uploadify – Limit to One Upload Only

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
$(document).ready(function() {
     $('#file_upload').uploadify({
        'swf' : '<?php echo $this->Html->url('/uploadify/uploadify.swf');?>',
	'uploader' : '<?php echo $this->Html->url('/uploadify/uploadify.php');?>',
	'cancelImg' : '<?php echo $this->Html->url('/webroot/uploadify/cancel.png');?>',
	'folder' : '<?php echo $this->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