From 05517b91440fcffbe8f96e4aa868aafb28379f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Jan=C4=8D=C3=A1r?= Date: Wed, 29 May 2024 12:15:34 +0200 Subject: [PATCH] Test --- .gitignore | 4 ++++ index.php | 1 - upload.php | 42 ------------------------------------------ 3 files changed, 4 insertions(+), 43 deletions(-) create mode 100644 .gitignore delete mode 100644 upload.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..842da44 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/uploads +uploads +/uploads/* +uploads/* \ No newline at end of file diff --git a/index.php b/index.php index 4ef9cbc..a240cfe 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["submit"])) { $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; - $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION)); // Check if file already exists if (file_exists($target_file)) { diff --git a/upload.php b/upload.php deleted file mode 100644 index 23f467f..0000000 --- a/upload.php +++ /dev/null @@ -1,42 +0,0 @@ - 500000) { - echo "Sorry, your file is too large."; - $uploadOk = 0; - } - - // Check if $uploadOk is set to 0 by an error - if ($uploadOk == 0) { - echo "Sorry, your file was not uploaded."; - // if everything is ok, try to upload file - } else { - if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { - echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded."; - } else { - echo "Sorry, there was an error uploading your file."; - } - } -} -else { - $files = scandir($target_dir); - echo "Názov súboruDownload"; - foreach($files as $file){ - $filename = $file; - $filepath = "/uploads/$file"; - echo "SuperSubor$filename"; - } -} -?> \ No newline at end of file