Images in different sizes stored in the file system. How to handle the filenames in the Database

by Rostislav   Last Updated May 15, 2018 16:05 PM

I have a dating site where each user has many photos. When the user uploads the photo, I create three different photo sizes - small, medium, big with different pixels. The question is how to persist the names of the files in the database. Should I have all three records with the file and path names, or I can have only the primary one and all others to be accessed via the hardcoded link with a prefix. Melanie.jpg is stored in the database with one record, and all other sizes can be accessed via:


In the other case, I will have for every one image, three records in the database.

Related Questions

Best approach for storing large 3d files?

Updated April 21, 2016 08:02 AM

Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-6-370976-images-in-different-sizes-stored-in-the-file-system-how-to-handle-the-filenames-in-the-database- could not be written