Answer the question
In order to leave comments, you need to log in
How to check what error is in $_FILES?
How to display a message about what error occurred, if for example:
post_max_size = 2M
and I send via post 4M, then I get 500 (Internal Server Error) in the console.
echo $_FILES[];
in console reports: undefined
echo $_FILES["images"]["error"];
does not report anything
Answer the question
In order to leave comments, you need to log in
According to the official documentation , post_max_size exceedance can only be tracked by adding a get parameter to the form:
<form action="edit.php?processed=1">
if (!empty($_GET['processed']) && empty($_POST) && empty($_FILES)) {
echo 'Ошибка! Вы загрузили слишком большой файл';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question