Click here to Skip to main content
15,746,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello EveryOne,
I have a question, What is the best way to save users Image profile?
My scenario is, this system has about
users and each of them could load their Image (Just one Image).
What is better to do this, save it in database or in a path? and why?
Thanks a lot.

What I have tried:

Save it in database or in server-path
Updated 20-Oct-20 21:44pm

Share this answer
While you can save images in a DB, that's only a good idea if the image is small and you have only a few of them. 100,000 images of any size is going to take significant amounts of DB space - even a 170x200 image will average around 25K, so you are looking at around 2.5GB of DB space to store them - and since they don't change often (or at all) it's a lot simpler to store them in a path and store the path in the DB. That way the images can be part of a separate - less frequent - backup system than the rest of the DB. And since pictures are generally already compressed they will make the more essential DB backups significantly bigger and slower!

And the bigger your images are, the worse the problem gets!
Share this answer
Moses_k 21-Oct-20 3:51am    
Thanks for your answer. I have just a profile Image and it is small and the same size.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900