Send Item Id When Upload File

Hi,

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='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />



Oh, Is it OK?

So tricky!!!!!;)