I want to echo back the filename and filepath once an image has been uploaded to the server?
The image upload works fine, and it echoes back "upload succesful"
can someone help? here is the bottom of my script:
// What is the files temporary name?
$file = $_FILES['userfile']['tmp_name'];
// What is the files actual name?
$filename = $_FILES['userfile']['name'];
// Does this file already exist on the server?
if(file_exists($uploaddir . $filename)) {
die("A file with that name already exists on this server.");
} else {
// This file does not already exist, so copy it.
copy($file, $uploaddir.$filename) or die("Could not copy file.");
}
// All done!
echo "Upload successful";
}
A+,CCNA
The image upload works fine, and it echoes back "upload succesful"
can someone help? here is the bottom of my script:
// What is the files temporary name?
$file = $_FILES['userfile']['tmp_name'];
// What is the files actual name?
$filename = $_FILES['userfile']['name'];
// Does this file already exist on the server?
if(file_exists($uploaddir . $filename)) {
die("A file with that name already exists on this server.");
} else {
// This file does not already exist, so copy it.
copy($file, $uploaddir.$filename) or die("Could not copy file.");
}
// All done!
echo "Upload successful";
}
A+,CCNA