CUploadedFile::getInstance() strange behavior

Good day!

For example, if we have CMultiFileUpload with name=>ProductImage[imageFile],

then first uploaded file $name in CUploadedFile::getInstance() will be ProductImage[0][imageFile], but it have to be ProductImage[imageFile][0], isnt it?

Or am i not understanding a thing?


foreach ($_FILES['ProductImage']['name']['imageFile'] as $key=>$file) {

    $productImage = new ProductImage;

    $image = CUploadedFile::getInstance($productImage,"imageFile[$key]");


CUploadedFile::getInstance() piece:


Yeah, right now CMultiFileUpload doesn't work with CUploadedFile. You need to manually manipulate $_FILES.

Ok then.

One more thing. This approach:

CUploadedFile::getInstance($someModel, "attributeName[$i]");

which mentioned in documentation, is for manually generated tabular input with several Chtml::activeFileField(), am i right?


Thanks a lot!