hello i have problem like every one ask this question with diffrent in my url
save image in backend\web\uploads folder and i want this image in backend and frontend together
i have backend with yii.com:81 url and i have frontend with yii.com
i use every solution to solve my problem but it don’t work
my view in frontend:not work
<?= \yii\helpers\Html::img( Yii::getAlias('@backend'). '/web/uploads/'.$model->image_web_filename) ?>
my view in backend work truely
if ($model->image_web_filename!='') {
echo '<br /><p><img src="'.Yii::$app->homeUrl .'uploads/'.$model->image_web_filename.'"></p>';
}
my controller to save image:work true
Yii::$app->params['uploadPath'] = Yii::$app->basePath .'/web/uploads/';
$path = Yii::$app->params['uploadPath'] . $model->image_web_filename;
$image->saveAs($path);