From: Jerome Jutteau Date: Sun, 3 Jul 2022 08:42:33 +0000 (+0200) Subject: Add more details about upload error X-Git-Tag: 4.5.0~26 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/6f6cfb13fc72f4baac6f6bd53e5c1c20f9715c9e?hp=689557880514b74d0e21a56b40fe16a78f3b1a65 Add more details about upload error ref #303 Signed-off-by: Jerome Jutteau --- 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"; }