From 211a1eb31997fbf199c24daafe807db0ab1e7aa4 Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Sun, 25 Jan 2026 22:25:19 +0100 Subject: [PATCH] Improve error handling for file uploads in upload.php --- upload.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/upload.php b/upload.php index ba8ce99..bf3690f 100644 --- a/upload.php +++ b/upload.php @@ -28,13 +28,17 @@ if (!isset($_FILES['uploadFile']) || !is_array($_FILES['uploadFile'])) $file = $_FILES['uploadFile']; -$fileError = isset($file['error']) ? (int)$file['error'] : UPLOAD_ERR_NO_FILE; -if ($fileError !== UPLOAD_ERR_OK) -{ - header('Location: account.php?upload=err'); +$fileError = $file['error']; + +if ($fileError !== UPLOAD_ERR_OK) { + echo "UPLOAD ERROR CODE: " . $fileError . "
"; + echo "UPLOAD MAX FILESIZE: " . ini_get('upload_max_filesize') . "
"; + echo "POST MAX SIZE: " . ini_get('post_max_size') . "
"; + var_dump($_FILES); exit(); } + // Basic Validierung $tmp = isset($file['tmp_name']) ? (string)$file['tmp_name'] : ''; if ($tmp === '' || !is_uploaded_file($tmp))