Hi Guys,
Can someone confirm for me that the code below will move an uploaded
file and give it the same name as the original image file name ?
$file_dir = "/home/uploads";
foreach($_FILES as $file_name => $file_array) {
echo "path: ".$file_array["tmp_name"]."<br/>\n";
echo "name: ".$file_array["name"]."<br/>\n";
echo "type: ".$file_array["type"]."<br/>\n";
echo "size: ".$file_array["size"]."<br/>\n";
$UploadName[$num] = $file_array["name"];
$num++;
if (is_uploaded_file($file_array["tmp_name"])) {
move_uploaded_file($file_array["tmp_name"], "$file_dir/".
$file_array["name"]) or die ("Couldn't copy");
echo "file was moved!<br/>";
}
}
Many thanks,
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php