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.
10 years ago
aryasharma wrote:
How could i increase website performance when store image in database?Please help me..



It all depends on your total amount of images, if you have a few about 1,000 i would say its ok to have them in databse. If you have more then this i would recommend out of database, for the simple fact that your database will be large so backing up would be a an issue.

Just my opinion ok.
I will have about 1500 and i am setup for image storing locally not database.
10 years ago
[email protected] wrote:
Where is Media.Images.StoreInDB in version 3.10?


You do that in admin -> configuration -> media setting
10 years ago
Hello !

I am storing the product's pictures on the server file system (and not in the database).

Where the path and the image name are stored?

I have check into Product and Picture tables but I was not able to find this information... Could you pinpoint me the table in which the image name is stored?

Thanks in advance,

MT
10 years ago
silat wrote:
Hello !

I am storing the product's pictures on the server file system (and not in the database).

Where the path and the image name are stored?

I have check into Product and Picture tables but I was not able to find this information... Could you pinpoint me the table in which the image name is stored?

Thanks in advance,

MT


https://www.nopcommerce.com/boards/t/27499/item-picture-url.aspx
9 years ago
Hi [email protected]

I'm using 3.30 & what you have to do is add the property Media.Images.StoreInDB
go to Administration -> Settings -> All Settings(Advanced) and Add new record:
Setting Name: Media.Images.StoreInDB
Value: False

nopCommerce will then use the "content/images/" directory to store the images.
BUT the images in the database will remain there in dbo.Pictures table and you will manually have to delete them.

I have also noticed that when I cleared out the old sample products and put in new ones, the images were not deleted from the database...something to look out for unless someone out there has an answer.
8 years ago
Team,
Storing images in binary format is hitting the page performance badly. We have many products image around 1/2 million images. Its better to store images in blog and store the url in db.

But I wanted to know how nop search engine will work? since it is expecting binary format of the images.

Please advice, how to handle this?

We are using the latest build of nopcommerce 3.6

Thanks,
Prasanna V.
8 years ago
In my opinion, storing image in db is more secure than in folder because if your website gets deleted for some reason (hardware failure, delete by accident....), your site images will get restored easily and safe. Code/web is not important, your data is the most important.

and as what LK said above, using db you'll have 2 backups of images, one in db and one in folder in which Nop outputs physical images from DB into Content/images....
8 years ago
We have planned to store images on Azure storage - Blob and store only the image path in Db. To achieve this what we have to do?

1. Will nopCommerce search code takes reference of image path and work without any problem?
2. Do we need to change any code to achieve this?
3. We are presently using latest nopCommerce build 3.6
8 years ago
LK wrote:

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


Have you followed that?

Go to admin/configuration/settings/media settings => change to files. Make sure you backup your database first.
8 years ago
congthanhgiong wrote:

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

Have you followed that?

Go to admin/configuration/settings/media settings => change to files. Make sure you backup your database first.


I also make the changes to put it in the file system since we have about 1 million pictures. And it is horribly slow. So I wanted to test in development machine, I have enough backup copies of the database.

I am trying this file system configuration in version 3.70 in my test machine and with new and empty the database. So backing database is not important. I did change under Administration > Configuration > Setting > Media Setting "pictures are stored into file system". But still it is adding values to binary field. no reference to picture url.

So even if I don't want to back it up,
Is there any hidden reason that we should backup database first (since you highlighted Make sure you backup your database first.)? Will it store picture url in Picture table instead of binary data field, if I back up the database even it is new and empty?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.