Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $file=CUploadedFile::getInstance($model,'file'); //prende il riferimento al file
- if($file != null) {
- // $dir2 = Yii::getPathOfAlias('application.uploads'); //il path alias
- $dir = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.uploads'));
- echo "dir".$dir;
- echo "percorso".$dir2;
- $file->saveAs($dir.'/'.$file->getName());
- $this->foto=$file->getName();
- }
Add Comment
Please, Sign In to add comment