I want to change the name of the uploaded file, to the current time by using time()
but i cant seem to figger out where to insert the new time name ?
can some one try look at this ?
<?php
if (!empty($_FILES)) {
$newName = time(); <-- Should be the new temp name, insted of the uploaded one.
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
}
echo '1';
?>