I would like to develop a website / web application, which will be used as a shopping website. Admin will be able to add new items (that users will be able to select) which will contain properties such as description, price, and also an image.
This will be my very first time building something like this and therefore I would like to know what are the best practices when storing images in a website / web application?
There are two approaches that came to my mind:
- Store images into a database and afterwards retrieve it from there. (problem I might have here is how to dynamically translate ByteArray into a real image that could be presented on a website)
- Save images as they are in a separate folder in my wwwroot. This way, when storing a new item into a database, instead of storing image as well, I would only store a path to the image that would be saved on a server disk.
For the mentioned project I would be using ASP.NET Core (MVC 6) and possibly some Angular as well.
Any ideas / recommendations / best practices / tips in this matter would be more than appreciated!