Dont worry, i understand how to upload files, but how can i rename them to something unique, and what is a good scheme for renaming pictures so there wont be duplicate names and can be added to a db. They will be added one at a time, so the names must come from somewhere. I'm not too sure
any advice?
Uploading files and renaming on the fly
Moderator: General Moderators
I've done it with a datetime-stamp (yy)(mm)(dd)(hh)(mm)(ss). I didn't want a random-number - there should still be some kind of order to the images you upload (to my mind :p ).
Example: "myImg.gif" will be "myImg200302072013222.gif
Basically every image will get an individual name every second(!). Make sure that on your form you catch double-clicking, i.e. double-submitting.
Code: Select all
$documentfile=ereg_replace(" ","",$documenttitle).(string)date("YmdHis").".".$documentwildcard;Basically every image will get an individual name every second(!). Make sure that on your form you catch double-clicking, i.e. double-submitting.