Reputation: 1774
I'm trying to save a CUploadedFile object in local folder, I am using img module for yii. I get this error:
CException Property "Image.path" is read only.
In Stack trace it shows that this is causing the error:
CActiveRecord->__set("path", "show_gallery"):
public function save($file,$name=null,$path=null)
{
....
if($path!==null)
$image->path=trim($path,'/');
...
and it is provoked by:
ImgManager->save(CUploadedFile, "some_name", "show_gallery"):
Yii::app()->image->save($modelPhoto->content,'some_name','show_gallery');
Upvotes: 0
Views: 977
Reputation: 136
This indicates that the property of the class Image is read-only, which also means there is no setter method for that property called path. It has nothing to do with the filesystem, but more with the code.
Are you using a 3rd party extension? Can you provide the whole Image model code?
Upvotes: 1