Hi everyone,
I created a web application using YII2. in my form I use the saveAs function to upload the files. the problem is that after the upload I can’t open the files in the server (C: //path…/image.jpg) it displays a message access denied, knowing that the image exists in the server and the same image can be open on the web (www.site.com/.../image.jpg).
I redid the same test with WORDPRESS for test and it works very well in the server and in the web.
So my question is:
Why it works fine with wordpress and not with Yii2 ?
do I need to change something in my Yii2 application configuration?
Please find below my import code,
if($model->save())
{
if($model->file != ""){
$model->file->saveAs('CV/'.$cvName.'-'.$cvPrenom.'-'.$time.'.'.$model->file->extension);
}
if($model->image != ""){
$model->image->saveAs('photos/'.$cvName.'-'.$cvPrenom.'-'.$time.'.'.$model->image->extension);
}
return $this->redirect(array('qcm/create'));
}
Thanks in advance, Thank you very much for your help