Co-k-ine
(Admin Angels)
1
Hello everybody,
I have an error with CUploadedFile, I can’t use it !
$model->avatarPath=CUploadedFile::getInstance($model,'avatarPath');
if($model->avatarPath->getHasError()) {
echo 'error';
exit();
}
I have this error :
Why I can’t call getHasError() ?!? Normaly CUploadedFile was copy in $model->avatarPath
kiran123
(Sharmakiran71)
2
why you set $model->avatarPath=CUploadedFile::getInst… … ?
you can refer This wiki article
Co-k-ine
(Admin Angels)
3
I already read this article.
I used this article: http://www.yiiframework.com/wiki/2/how-to-upload-a-file-using-a-model/
But the problem remains the same: I can not use methods CUploadedFile
rall0r
(Rall0r)
4
It looks like CUploadedFile::getInstance is not returning the right object.