1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

upload-file.php: Allow upload of redundant files

This commit is contained in:
avni 2025-01-17 23:03:01 +01:00
parent f8b743dafc
commit 271da50114

View file

@ -20,15 +20,17 @@ if(!isset($_POST["submit"]) || !is_uploaded_file($_FILES['uploaded_file']['tmp_n
} elseif (!isFileMimeTypeAcceptable($_FILES["uploaded_file"]["tmp_name"])) { } elseif (!isFileMimeTypeAcceptable($_FILES["uploaded_file"]["tmp_name"])) {
$upload_msg = "You can not upload zips, executables, xml, and other high-risk files!"; $upload_msg = "You can not upload zips, executables, xml, and other high-risk files!";
$upload_ok = 0; $upload_ok = 0;
} elseif (!isFileContentUnique($target_folder_path, $_FILES["uploaded_file"]["tmp_name"])) {
$upload_msg = "This file already exists!";
$upload_ok = 0;
} elseif (file_exists($target_file)) { } elseif (file_exists($target_file)) {
// rename file so name is unique // rename file so name is unique
$new_filename = getUniqueFileName($target_folder_path, $uploaded_filename); $new_filename = getUniqueFileName($target_folder_path, $uploaded_filename);
$target_file = $target_folder_path . "/" . $new_filename; $target_file = $target_folder_path . "/" . $new_filename;
} }
#elseif (!isFileContentUnique($target_folder_path, $_FILES["uploaded_file"]["tmp_name"])) {
# $upload_msg = "This file already exists!";
# $upload_ok = 0;
#}
// Check if $upload_ok is set to 0 by an error // Check if $upload_ok is set to 0 by an error
if ($upload_ok == 0) { if ($upload_ok == 0) {
$upload_msg = "❌ Your file was not uploaded. " . $upload_msg; $upload_msg = "❌ Your file was not uploaded. " . $upload_msg;