Re: File Uploads!
| From: | Catalin Trifu | Date: | Mon, 30 Jun 2003 11:51:23 +0000 |
| Subject: | Re: File Uploads! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153392@lists.php.net to get a copy of this message | ||
Hi,
In case someone is interested I found the workaround.
1. IE6 does not take into consideration MAX_FILE_SIZE,
so one can not rely on it on client side.
2. If the uploaded file exceeds the post_max_size, the PHP
engine (4.3.1 in my case) does not give you any error in the PHP
script which handles the upload, nor does it take into consideration
MAX_FILE_SIZE. It simply logs the error as shown and does
not even parse the post data anymore.
So, the workaround is to make the post_max_size large enough
so that it fits, like 100MB and the PHP will take into consideration
the MAX_FILE_SIZE, discard the upload and give you the
$_FILES['userfile']['error'] = UPLOAD_ERR_FORM_SIZE
I for one consider this a flaw in the engine.
Anyway, hope this helps,
Catalin
"Catalin Trifu" <catalin@isp-software.de> wrote in message
news:20030629115021.28563.qmail@pb1.pair.com...
> Hi,
>
> This is the error I get in the log file:
> [error] PHP Warning: POST Content-Length of 11184886 bytes exceeds the
> limit of 8388608 bytes in Unknown on line 0
>
> This is absolutely correct. The problem is
> this error does not reach my PHP script and I
> have no idea how can I tell my user he posted
> a file which exceds the size.
> The $_FILES is empty, same for $HTTP_...
> Any idea is appreciated.
>
> Cheers,
> Catalin
>
>