If you have no other way of finding the file, storing its path in the DB is probably OK.
Still, a couple of notes :
- I would generally try to see if I could "guess" the file's path from another field -- for instance, from the primary key
- If it's possible, then, there is no need to store the path in the DB, as it would be some redundant information
- I would, as much as possible, store some relative path, and not an absolute one.
- For instance, I would store
images/my/image-test.png
- But not
/var/www/images/my/image-test.png
- That way, moving the directory with the images to another place, or changing of server, using a new one with another path to the DocumentRoot, would still be OK and not break my application.