I am developing a web application that must store various images. An example could be a celebration site: You will find occasions which have Flyers + Photos (owned by a celebration) and Locations where also have photos (owned by an area). However I possess some troubles creating a perfect solution for those this, because I wish to be very flexible. So Photos ought to be obtainable in multiple resolutions, Flyers will have a back side and pictures too.

Presently I simply store the road to the initial image within the database and "calculate" another pathways with adding "_small" or "_800x600" towards the file title. However with this method I must cleanup all of the pictures when altering a flyer, because I do not keep an eye on the pictures.

What exactly is the greatest practice with this? Must I keep pathways for that pictures too? What are the famous good examples regarding how to do that? It appears just like a rather prevalent problem.

Thanks ahead of time.