if (isset($_FILES['file']['name'])) {
if ((($_FILES['file']['type'] == 'image/gif') || ($_FILES['file']['type'] == 'image/pjpeg')) && (($_FILES['file']['size']
< 512000))) {
if (file_exists('pics/' . $_FILES['file']['name'])) {
echo "File already exists!";
} else {
// Rename file using the date rename
// This is where I give it a new name
$_FILES['file']['name'] = "New_name";
move_uploaded_file($_FILES['file']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . 'pics/' .
$_FILES['file']['name']);
echo "File uploaded sucessfully.";
$newpicname = $_FILES['file']['name'];
unlink($oldpic);
}
echo $newpicname;
echo $name;
}
Ok, this script will upload the file.. In fact it even renames the file to "New_name" However, the problem is that i can't attatch the original extention on to the new name.
any suggestions?
Thank you
Anthony