From 6f6cfb13fc72f4baac6f6bd53e5c1c20f9715c9e Mon Sep 17 00:00:00 2001 From: Jerome Jutteau Date: Sun, 3 Jul 2022 10:42:33 +0200 Subject: [PATCH] Add more details about upload error ref #303 Signed-off-by: Jerome Jutteau --- lib/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/functions.php b/lib/functions.php index 1444c1f..46c004a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1008,6 +1008,11 @@ function jirafeau_async_push($ref, $data, $code, $max_file_size) if ($a['next_code'] != "$code") { return "Error: bad transfer code"; } + if ($data['error'] != UPLOAD_ERR_OK) { + // Check error code in https://www.php.net/manual/en/features.file-upload.errors.php + $data_details = print_r($data, true); + return "Error: upload error: {$data_details}"; + } if (empty($data['tmp_name'])) { return "Error: missing tmp_name"; } -- 2.34.1