Saving Images In Another Webapp

Hi all!

Prolly a fast one for the experienced users.

I have a webapp for my public_html and one for my admin_html, server-root like this:







Separating the backend totally from the frontend.

My problem is when im uploading images in my backend, i cant seem to save them in my frontend… iv’e tried several variations like:



ive allso tried Yii::setPathOfAlias(‘public_images’, ‘/public_html/images/’);

Anyone care to tell me where i stepped wrong? :)

Appriciate it!

Dear Friend


The above code would save the image in webroot folder itself.


The above code will save the image in webroot/images folder.


Thank you,

that is an improvement on the code. But i cant seem to work out how thats helpfull to my actual problem :)

Anyone have any sulution on saving an image in folders behind the webroot and application?

Dear Friend

Kindly check that whether the following is helpful to you.

I hope there may be better and simpler solution exists.

Now I have two applications(yii) in my localhost.



Now we want to save images from application boost into a folder residing in application nivas.

That means we want to save in /var/www/nivas/images.

The following is the controller logic in boost.

public function actionUpload()


	$model=new FileForm;






		foreach($files as $file)






Yii::app()->basePath;//   /var/www/boost/protected

dirname(Yii::app()->basePath);//    /var/www/boost 

dirname(dirname(Yii::app()->basePath));//  /var/www

dirname(dirname(Yii::app()->basePath))."/nivas/images";//   /var/www/nivas/images 

I hope I helped a bit.