fouss
(Jsfousseni)
June 4, 2012, 7:02pm
1
I’m using CMultiFileUpload widget the normal way and it’s working fine but I sometimes don’t able users to upload files; that’s when $max=0. But when that happen they can upload unlimited files!
So how to make this widget not to be able to accept files to uplooad?
$this->widget('CMultiFileUpload', array(
'name' => 'images',
'max'=>$mx, // not wrking if $max=0
'accept' => 'jpeg|jpg|gif|png',
'duplicate' => 'Duplicate file!',
'denied' => 'Invalid file type',
));
l.jurgs
(L Jurgs)
June 5, 2012, 1:40am
2
Hey,
How about using the htmlOptions disabled attribute to disable the input.
$this->widget('CMultiFileUpload', array(
'name' => 'images',
'max'=>$mx, // not wrking if $max=0
'accept' => 'jpeg|jpg|gif|png',
'duplicate' => 'Duplicate file!',
'denied' => 'Invalid file type',
'htmlOptions' => array('disabled' => (0 === $mx ? true : false)),
));
fouss
(Jsfousseni)
June 6, 2012, 1:39am
3
Hey,
How about using the htmlOptions disabled attribute to disable the input.
$this->widget('CMultiFileUpload', array(
'name' => 'images',
'max'=>$mx, // not wrking if $max=0
'accept' => 'jpeg|jpg|gif|png',
'duplicate' => 'Duplicate file!',
'denied' => 'Invalid file type',
'htmlOptions' => array('disabled' => (0 === $mx ? true : false)),
));
Yes, working…
I undestand much this way
$this->widget('CMultiFileUpload', array(
'name' => 'images',
'max'=>$mx, // not wrking if $max=0
'accept' => 'jpeg|jpg|gif|png',
'duplicate' => 'Duplicate file!',
'denied' => 'Invalid file type',
'htmlOptions' => array('disabled' => ($mx==0 ? true : false)),
));