Renaming file Uploads
Friday October 27, 2006
When you allow file uploads it is a good idea to rename them as they come in to prevent accidentally overwriting files because they have the same name. This script shows you how to rename them to a random number or a timestamp before they are saved to the server.


Comments
I’m having problems adding the “limiting files by size” and “restricting certain file types” code to this “Renaming file Uploads” code. What’s happening is if i try to upload a file with a wrong extention, even though the error message comes up in the browser it’s still getting uploaded and renamed on the server.
This was really helpful in producing a screenshot database, thanks a load!!