On Tue, Oct 1, 2019 at 8:25 AM Benjamin Morel <benjamin.mo...@gmail.com> wrote:
> > Perhaps a more generic $_SERVER['PHP_REQUEST_STATUS'] or something along > those lines where you'd put the error message from > https://www.php.net/manual/en/features.file-upload.errors.php as well. > And add new states for these exceeded limits that aren't caught there. It > would be nice if you just needed a single check instead of having to look > for multiple things. > > Those are per-file error codes, that belong in each $_FILES entry, while > the errors I'm talking about affect the whole request, so I'm afraid you > cannot put these errors in the same place, nor can you extend the existing > error codes, as they do not have the same scope! > I know they are per-file errors. I wrote that code :) But you could still have a global status that specifies whether an error occurred or not. Then you can go look for which file it occurred on in the $_FILES array. The idea is to have a single check that tells you if everything was fine on the request. -Rasmus