I found this small script below that allows me to upload a file to a specified folder. I would like to know how I can rename the image or document to something unique like say a five digit number? Thank you in advance.
<?php
$file_name = $HTTP_POST_FILES['ufile']['name'];
$new_file_name=$file_name;
$path= "uploads/".$new_file_name;
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Uploaded success<BR/>";
echo "File Name :".$new_file_name."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
}
else
{
echo "Error";
}
}
?>