activeFileField with 'multiple' option


I have set the multiple option to an activeFileField like this :

<?php echo CHtml::activeFileField($model, 'logo_big', array('multiple' => true)); ?>

It works, I can select multiple files at once, and just next to the input instead of the file name, there are the number of files I’ve selected.

So it works. But then when I post the form, I can’t get all the files I’ve uploaded.

I tried CUploadedFile::getInstances($model, ‘logo_big’), but I only get one file.

Any idea to get all the files?


print_r($_FILES) to see how many files have passed to the server end .

normally we use CMultiFileUpload

or ajaxUpload , flash to upload multiple files (you can find many extension in this site (just use keyword to search ) for upload multiple files) :lol:

$_FILES has just one file :confused:

Now I use CMultiFileUpload and it works, but the things I’ld like to select multiple files

at once but it seems impossible with it. Any idea for this?

Thanks for your help!

I’m wanting to do this exact same thing. Have you found a way to do it?