When displaying images on our website, we check if the file exists with a call to file_exists(). We fall back to a dummy image if the file was missing.
file_exists()
Howe
When you save a file to a folder, if the upload was successfully, you can store the path to a DB Table.
Then you will just have to make a query to the database in order to find the path of the requested file.