Images in Database
https://bitbucket.org/z_bodya/yii-image-attachment/issues
My images are stored in database and not in directory, how can I change the behavior.
Thanks
Comments (5)
-
repo owner -
reporter Hi Bogdan. I have the images stored in the database. So thats why I thought how could I use the extension. I can change that to store images locally and only path in the table. Anyways, do you know how my image table in database should look like to use the extension? I have the following columns in the image table ImageId, ProductId, ImagePath, ImageCaption,MainImageindicator. Where does model->preview->hasImage() look for images? E.g if I assign a $model, where can I assign the path etc., to the I mean where and how will it store image location information and caption information in the database?
Thanks a lot!
-
reporter - marked as enhancement
-
repo owner I have the images stored in the database. So thats why I thought how could I use the extension. I can change that to store images locally and only path in the table. Anyways, do you know how my image table in database should look like to use the extension? I have the following columns in the image table ImageId, ProductId, ImagePath, ImageCaption,MainImageindicator.
I did not understood what you want to do.. Seems we have different vision about what is meant to "store images in database". By storing images in database I mean - storing image data (content of image file) in database.
Where does model->preview->hasImage() look for images? Have you even read the readme file, do extension description? path to store images in specified in behavior configuration...
E.g if I assign a $model, where can I assign the path etc., to the I mean where and how will it store image location information and caption information in the database?
Extension purpose is to attach image to row in database, nothing more. There is no need to store image location - it can be generated using id and behaviour configuration.
About caption: there is no such feature in extension, and it is not what this extension designed for.
-
repo owner - changed status to wontfix
Anyway, storing images in database will require a lot of changes, and it would be another extension with another use cases - it is not an enhancement or a feature.
So I will not do this - if you need this, fork this repo, and do it on your own.
- Log in to comment
I am missing - what the problem is?
You need to store images in database, and asking how this can be done?
Such feature was not originally planned, so it can not be easily done... But, in general, it also is not hard to modify this extension to support this.