move_uploaded_file() Unable to move using yii framework -
i'm trying upload file yii framework when error appears
move_uploaded_file() [function.move-uploaded-file]: unable move '/tmp/phpledrdu' 'http://wmtunisia.com/tamtamtravel.tn/upload/2013-05-03entry_3.jpg'
and i'm doing in controller
public function actioncreate() { $model=new voitures; if(isset($_post['voitures'])) { $model->attributes=$_post['voitures']; $model->image=cuploadedfile::getinstance($model,'image'); if($model->validate()) { if(!empty($model->image)){ $rep = yii::app()->params['webroot'].'upload/'; $model->image->saveas($rep.date('y-m-d').$model->image); $model->image=date('y-m-d').$model->image; } $model->description= chtml::encode($_post['voitures']['description']); $model->save(); yii::app()->user->setflash('save',"la voiture été enregistrée avec succes!"); $this->redirect(array('admin')); } } please can ?
what yii::app()->params['webroot'] equal in case?
according error text, refers url, has path on server https://github.com/yiisoft/yii/blob/master/framework/web/cuploadedfile.php#l188
try use yii::getpathofalias('webroot') instead.
Comments
Post a Comment