How to change media settings from database to filemanager in nopCommerce

A lot of developers prefer to store all the images (including products, categories, profile avatar, manufacturer images etc) in filemanager as compared to storing everything in the database. The reason is quite simple, the more products you add, the more images you will have and hence the size of the database will increase drastically if you keep storing all the media in your database. This can lower down the performance of your website significantly if you have a lot of products/media on your store site.

The database is set as the default location for media in nopCommerce out of the box. It is always good idea to change it to "filemanager", if you are planning to add many products.

Point#1: It is recommended to make a backup of the database before changing this option.

Point#2: If you change the settings to "filemanager", then all the images will be saved on the hosting server hard-drive / directory where you have your web files. 

Let's go over the process of changing the media settings from database to filemanager.

First, login to your nopCommerce store site as admin and go to administration section.

Now, go to: Configuration > Settings > Media Settings

nopCommerce media settings



Now, click on the "change" button where it says "Pictures are stored into..." like this:

nopCommerce media settings

Save, it and now you are all set!

Some other information: One the same page, you will see media settings for your images such as:

- Avatar image size: The default size (pixels) for avatar images

- Product thumbnail image size (catalog): The default size (pixels) for product thumbnail images displayed on category or manufacturer pages

Product detail image size: The default size (pixels) for product detail images

Product thumbnail image size (product page): The default size (pixels) for product thumbnail images displayed on product details page when you have more than one product image

Associated product image size: The default size (pixels) for associated product images (part of 'grouped' products)

Category thumbnail image size: The default size (pixels) for product thumbnail images on category pages

Manufacturer thumbnail image size: The default size (pixels) for product thumbnail images on manufacturer pages

Cart/Wishlist thumbnail image size: The default size (pixels) for product thumbnail images on the shopping cart and wishlist

Mini-shopping cart thumbnail image size: The default size (pixels) for product thumbnail images in the mini-shopping cart block

Maximum image size: The maximum image size (longest side) allowed for image uploads

Multiple thumb directories: Check to enable multiple thumb directories. It can be helpful if your hosting company has some limitations to the number of allowed files per directory


Hope it helps!

About Author

Written By Lavish Kumar

Based out of New York, USA, Lavish Kumar is a full stack web developer by profession and founder of Striving Programmers, a trusted community for developers that offers a wealth of articles and forums to assist individuals with improving their software development skills.

Leave your comment
Comments
10/26/2015 5:22 PM
Thanks for this post, Lavish.  

How do we configure NOP to store images not in DB/file system, but say in azure cloud. So essentially, upload the images to azure storage, get the URL, and store the URL in nopcommerce database. Is there a way to achieve this?