Add And Remove Dynamically - Cmultifileupload


I have some validation on FileSelect in CMultiFileUpload. After checked validation , returning false.

But before returning false, want a create new file uploader element and remove old one.

Is this possible. If yes please suggest me how can I do this.

$this->widget('CMultiFileUpload', array(






	 'onFileSelect'=>'function(e ,v ,m){

	                if(validateUplaodFileOnSelect(e) == false) {

                                //here I want create new element and remove old one.

	                	return false;	





     'denied'=>'Only JPG file is allowd',

     'duplicate'=>'File already in Attachment list',