C
C#5w ago
Mihneas22

Storing and displaying images

Hello! I have a blazor web app with an Asp.Net Core API and a SQL Server Db. I want to store images in my database as varbinary(max) datatype and i want to insert them and read them whenever I want in my website. But I can't find any meaningful resources that explain how to do that. Can anyone help or give some advice? Thx
6 Replies
Angius
Angius5w ago
Bad idea Store the images on a CDN or in the filesystem and only keep their path or URL in the database
Mihneas22
Mihneas22OP5w ago
how does the filesystem work
Angius
Angius5w ago
Just make a file on the disk
glhays
glhays4w ago
Agreed, storing images in data storage can become extremely large, with a pita management scenario.
glhays
glhays4w ago
Take look at how nopcommerce does their Media services. Maybe you can get some reference from it, and adopt your own from it. https://github.com/nopSolutions/nopCommerce/blob/develop/src%2FLibraries%2FNop.Services%2FMedia%2FPictureService.cs
GitHub
nopCommerce/src/Libraries/Nop.Services/Media/PictureService.cs at d...
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart. - nopSolutions/nopCommerce
Mihneas22
Mihneas22OP4w ago
thx

Did you find this page helpful?