CostaRico / yii2-images

Yii2-images - behavior-based module for resizing, storing, caching and attaching images.
160 stars 97 forks source link

error 404 #82

Open sinergycode opened 6 years ago

sinergycode commented 6 years ago

Hi, i made all like in the documentation, and the image is saving, but in the view i get 404 error. Can you help me?

sinergycode commented 6 years ago

Detalis: The installation was successful. The code was set up the same as in the documentation. All is well, the picture is saved on the server but in the view it is not displayed:

         [
             'attribute' => 'image',
             'value' => "<img src = '{$img->getUrl()}'>",
         ]

Result:

img src = '/19/images/image-by-item-and-alias?item=News1&dirtyAlias=b955bdfb6b-1.jpg' If i put:

         [
             'attribute' => 'image',
             'value' => "<img src = '{$img->getUrl()}'>",
             'format' => 'html',
         ],

then do not show up - error 404

N1kolayS commented 6 years ago

Hi! I have a same problem. After update my old project. (upgraded Yii Framework from version 2.0.12 to 2.0.14.2.) . getImage() must return same path "yii2images/images/image-by-item-and-alias?item=" instead "/19/images/image-by-item-and-alias?item="

Sorry for my English )

sinergycode commented 6 years ago

Ok, thanks for information.

synatree commented 5 years ago

Yes, it seems you have to use the module id, then /images... so yii2images/images/...

It didn't used to be this way, I'm not sure why this is happening now. I will post if I find a workaround.