Okay in the following php code I need to modify it so that this part is unique.
Code:
/home/forbushj/www/video.flv
How do I make the Id unique using time?
so
theuniquename.flv
theuniquename.jpg so they have the same unique name? but one jpg the other flv meaning I could use them for the same purpose.
//This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if (!($uploaded_type=="video/x-ms-asf")) {
echo "You may only upload movies.<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
//COnvert the video
//echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
exec('ffmpeg -i '. basename( $_FILES['uploadedfile']['name']).' -ar 22050 -ab 32 -f flv -s 320x240 /home/forbushj/www/video.flv');
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>
That will return a date with a four digit year, two digit month, two digit day, 24 hour number, minutes, seconds, and milliseconds, all separated by a period. You can concatenate that to the end of anything to make a completely unique name that will never repeat.
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me