As a continuation of PHP Upload A File , we are going to use the function move_uploaded_file to move the uploaded file to the path where it is to be moved to ($target_path).
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo “The file “. basename( $_FILES['uploadedfile']['name']).
” has been uploaded”;
} else{
echo “There was an error uploading the file!”;
}
If the destination file already exists, it will be overwritten.
Be First To Comment
Related Post
Leave Your Comments Below