Send Item Id When Upload File


I would like to send an id to my controller when I upload a file :

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

                    'name' => "Multi[elementid][$element->id]",

                    'duplicate' => 'Duplicate file!',


in the controller how can I get back the $element->id ?

$multi = CUploadedFile::getInstancesByName('Multi');

Thanks for help

You can’t. You have to post those ids in a separate field and then read in before processing uploaded files and read each file separately using getInstaceByName() and ‘[X]attribute’ notation.

YES I CAN, with trick :)

and here the answers

foreach($_FILES['File']['name']['elementid'] as $key => $value) // key is my ID <img src='' class='bbc_emoticon' alt=':)' />

Oh, Is it OK?

So tricky!!!!!;)