Hey guys...
How do I set a filename using the code below? I'd like for the image to be called header.jpg and overwrite the existing file of the same name.
PHP Code:if (!isset($HTTP_POST_FILES['banner'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['banner']['tmp_name'])) {
if ($HTTP_POST_FILES['banner']['size']>$max_size) { echo "The file is too big"; exit; }
if (($HTTP_POST_FILES['banner']['type']=="image/jpeg")) {
$res = copy($HTTP_POST_FILES['banner']['tmp_name'], $path .
$HTTP_POST_FILES['banner']['name']);
if (!$res) { $msg2 = "Upload Error"; exit; }
else { $msg = "Update Processed"; }
}
else { echo "Wrong file type"; exit; }
}
$my_file = $HTTP_POST_FILES['banner']['name'];



Reply With Quote


Bookmarks