Update page with upload/delete

This commit is contained in:
2021-10-23 19:23:29 +03:00
parent 2edb4e445f
commit 3343dcf928
4 changed files with 22 additions and 43 deletions

View File

@@ -7,13 +7,13 @@
$filename = $path['filename'];
$ext = $path['extension'];
$temp_name = $_FILES['file']['tmp_name'];
$path_filename_ext = $target_dir.$filename.".".$ext;
$path_filename_ext = $target_dir . $filename . "." . $ext;
// Check if file already exists
if (file_exists($path_filename_ext)) {
echo "Sorry, file already exists.";
}else{
move_uploaded_file($temp_name,$path_filename_ext);
} else {
move_uploaded_file($temp_name, $path_filename_ext);
echo "Congratulations! File Uploaded Successfully.";
}
}