From 8c471ca0679e862eab4c060f19eeb71aaee083a1 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 25 Apr 2024 10:48:02 +0200 Subject: [PATCH] Add file upload --- lib/upload.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/upload.php b/lib/upload.php index 729ce3d..f5f02bd 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -131,10 +131,9 @@ function parseIncomingFiles(): array $success = true; print_r($incomingFiles); foreach ($incomingFiles as $incomingFile) { - echo "a:" . ($incomingFile["error"] == 0 ? "A" : "B") . "b:" . (is_file($incomingFile["tmp_name"]) ? "A" : "B"); if ($incomingFile["error"] == 0 && is_file($incomingFile["tmp_name"])) { $type = explode("/", $incomingFile["type"]); - if ($type == "image") { + if (str_starts_with($type, "image")) { echo "Adding " . $incomingFile["name"]; $imgFname = pathinfo($incomingFile["name"], PATHINFO_FILENAME); $uploadPath = getUploadPath("image", $imgFname);