Storing Image Path and not the pictures in the database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I have a question about storing images path, instead of storing the images in the databse.

I changed the setting to not store the media in the database. But, my question is where does NopCommerce store the path in the database. I am not sure if it's in the ProductPicture, because it's showing '0x' in the PictureBinary field.

Reason, I want to know is becuase I am writing a program to load the products and the variants in the database instead of doing one by one. I can load the products and variants anb pictures using this program.

Also, I see a benefit of not storing the pictures in the database, but just the path. That way I can change the pictures in the dirtectory, as long I keep the same name, pictures should be refreshed.

Please advise.
13 years ago
sanjuk72 wrote:
I have a question about storing images path, instead of storing the images in the databse.

I changed the setting to not store the media in the database. But, my question is where does NopCommerce store the path in the database. I am not sure if it's in the ProductPicture, because it's showing '0x' in the PictureBinary field.

Reason, I want to know is becuase I am writing a program to load the products and the variants in the database instead of doing one by one. I can load the products and variants anb pictures using this program.

Also, I see a benefit of not storing the pictures in the database, but just the path. That way I can change the pictures in the dirtectory, as long I keep the same name, pictures should be refreshed.

Please advise.


If you set 'Media.Images.StoreInDB' to 'false', then BinaryData is NOT stored into Nop_Picture table

If you are not storing the images in the database (   in Nop_Pictures (dbo)   )

then the image is put in a folder (as decided by the image path in picturemanager)

the image is renamed  with a number which equates to the picture id in the above mentioned database table

and copies are created in 'thumbs'  named depending on the media images sizes set in global settings

For more information, take a look at : Libraries\Nop.BusinessLogic\Media\picturemanager.cs
13 years ago
Confirmed - workes nicely for me on NOP1.8! On 70.000 product store it cut down amount of memory hogged by SQL server by about 1 GB ..  The store doesn't work much faster (just a bit faster) but the whole server is more stable.

In general when you have lots of pictures (1 GB+ in my case) keeping them in database doesn't seem such a good idea...
13 years ago
i want use images.mydomain.com, i hate store the pic to db.
13 years ago
How about don't change the image name? For my images use sku as name, it would be great if I don't need to modify.
10 years ago
HI...
I decided (a not great day) to perform the switch from db to file.system pictures storing... since that, i can see nomore any pictures... Now i upload directly the pictures into the thumbs dir (im very happy 4 this), but exists some way to copy the old pictures (the stored in db), into the dir, or it'll be done manually??
10 years ago
oops... i answered by myself... the issue is related to i/o permission in picture webserver directory of iis user, Now infact i setted permission, and redone the change, and all works properly
10 years ago
Can anyone please tell me where this picturemanager is in v320. I would like to strip out the extra zeros, is this even important? Thank you
10 years ago
How could i increase website performance when store image in database?Please help me..
10 years ago
Where is Media.Images.StoreInDB in version 3.10?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.