Re: Error when POST / upload limits are exceeded

From: Date: Tue, 01 Oct 2019 20:26:10 +0000
Subject: Re: Error when POST / upload limits are exceeded
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-107359@lists.php.net to get a copy of this message
On Tue, Oct 1, 2019 at 8:25 AM Benjamin Morel <benjamin.morel@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

« previous php.internals (#107359) next »