We decided our best approach would be to name the files based on the contents of the file. If the contents changed, so did the filename.
$filename = md5(file_get_contents($pathToFile));
The MD5 hashed filename is what was linked to the user logos. This turned out to be a fantastic solution for our needs.
What naming conventions do you use for user uploaded files? This method seems like it would work well for any uploaded files because nothing would ever be the same. Do you agree or disagree? Why?
No comments:
Post a Comment