Re: Quickform maxFileSize request for change in behaviour
| From: | Yuri Weseman | Date: | Wed, 27 Jul 2005 11:55:09 +0000 |
| Subject: | Re: Quickform maxFileSize request for change in behaviour | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-38967@lists.php.net to get a copy of this message | ||
Hi Bertrand,
Thanks for your quick reply! Before posting my message I already noticed
that method existed.
Three things I'd like to note:
- there is a default setting in PHP called upload_max_filesize which can be
set through php.ini, htaccess or ini_set
- Quickform differs from this default setting through a hidden form element
which is secretly slipped into the form (it took me 2 hours this morning to
find out what happened)
- The default setting Quickform chooses for maxFileSize seems quite
arbitrary (has there been discussion about this?)
Of course I could use setMaxFileSize everytime I instantiate HTML_Quickform,
which is a minor inconvenience. But when I've already decided through other
means what the maximum upload filesize should be I think that classes in PHP
should follow that decision and not decide something for themselves, unless
there is a really good reason to.
Kind regards,
Yuri
On 7/27/05, Bertrand Mansion <bmansion@mamasam.com> wrote:
>
> Yuri Weseman wrote:
>
> >Hi,
> >
> >Today I tried uploading a file using Quickform. It works, but only when
> your
> >files are smaller than 1MB. Quickform uses a hidden input field, named
> >MAX_FILE_SIZE. This prevents files larger than that size from being
> upoaded.
> >The value is hardcoded to 1 megabyte in Quickform.php. I'd like to
> suggest
> >to change this behaviour. I've added a patch file, that shows the change..
> >The patch file was created with diff on version 3.2.4pl1 (QuickForm.php,v
> >1.151).
> >In the constructor of Quickform.php I would add a check for the value of
> >upload_max_filesize. If it is correctly set, we can use this value to set
> >the default behaviour to use this value instead of 1MB.
>
> Hi,
>
> There is a setMaxFileSize() method for that already.
>
> Regards,
>
> Bertrand Mansion
> Mamasam
>
>