What are some ideas out there for storing images on web servers. Im Interacting with PHP and MySQL for the application.
Keeping relevant file names can be good for SEO, but you must also make sure you don't duplicate.
In all cases I would rename files to lowercase and replace spaces by underscores (or hyphens)
Justin Beiber Found dead.jpg =>
If the photo's belongs to an article or something specific you can perhaps add the article ID to the image, i.e.
123_justin_beiber_found_dead.jpg. Alternatively you can store the images in an article specific folder, i.e.
Naming the files like
a0000001 removes all relevance to the files and adds no value whatsoever.
Store (full) filepaths only in the database.
For part 2;
I'm not sure what the best solution here is, but using the filesystem, I think you will have to configure apache to serve all files in a particular directory by PHP. In PHP you can then check if the file can be published and then spit it out. If not, you can serve a dummy image. This however is not very efficient and will be much heavier on apache.