yii2 display image not found error -


i've got problem displaying image i've uploaded imagine.

now in view file have

<?= html::img("@uploads/$file->hash/$file->hash-$typethumbnail.$file->extension")  ?> 

which correctly displays in browser

<img src="/home/user/projects/project/_protected/runtime/uploads/1d30a595950237c599deb4fe02750489/1d30a595950237c599deb4fe02750489-2.jpg" alt=""> 

this file exists in directory. i've made 777 permission each folder , file in project folder still receive 404 not found error...

what doing wrong?

try use code, this.

$img = yii\helpers\url::to('@web/uploads/').$file->hash.'/'.$file->hash-$typethumbnail.$file->extension;                  $image = '<img src="'.$img.'" width="600" />';    <img src="<?= yii::$app->request->baseurl . '/backend/web/uploads/' . $file->hash.'/'.$file->hash-$typethumbnail.$file->extension ?>" class=" img-responsive" >   

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -