PDA

View Full Version : How do i...



Forge
09-12-2007, 06:28 PM
On my image upload script when an image is uploaded it is stored as the same name e.g. image.gif is uploaded as image.gif.
I want it so that when it is uploaded it is called image54654096.gif (the number being randomly generated everytime).
The main reason i want this is because on Forgeload V1.0 you can only upload image.gif once as it is stored in the folder in that name.

Does anybody know how to do this? +Rep
Cheers ;)

Moved by Agesilaus (Forum Moderator) from Design and Development: Moved to the appropriate specific forum for this discussion. ;)

MrCraig
09-12-2007, 09:09 PM
$fname = uniqid("");
move_uploaded_file($_FILES["file"]["tmp_name"],"images/$fname");


Should work.

Want to hide these adverts? Register an account for free!