Hello everyone.i have a guestion .where should i keep my project’s images in my aplication? Is it good to keep then database ?or i should keep them in the project folder
Loading
Hello everyone.i have a guestion .where should i keep my project’s images in my aplication? Is it good to keep then database ?or i should keep them in the project folder
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Sep 8, 2022, 10:31 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Sep 8, 2022, 12:27 PM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Sep 8, 2022, 12:41 PM EDT
Ram M61 reputationPosted Sep 8, 2022, 10:15 PM EDT
Uttam KumarRank #1,076 · 1.8K reputationPosted Sep 8, 2022, 10:28 PM EDT
Patel134 reputationPosted Sep 8, 2022, 10:56 PM EDT
Chris LoveRank #332 · 7.5K reputationPosted Sep 9, 2022, 1:30 PM EDT
Instead keep a path reference to your images. This could be a key, file name + path, etc. Something so your code will know where the image is.
If you are doing a web application the folder path is more a personal preference. I like dropping images in the /img folder. Partially b/c I started web dev back in 92, so short URLs were preferred. But I can and do use other folders for other image types. For example I keep all my PWA home screen icons in the /meta folder because I consider those images meta data of source. Not really part of the application itself, but part of the application identity.
Also, by keeping images as actual files you can cache and reuse them around your UX as needed instead of duplicating the data as part of an entity model/record.