RE : [PEAR] [QuickForm] file upload and rules
| From: | Yann \(zebulon-fr\) | Date: | Tue, 19 Nov 2002 17:01:46 +0000 |
| Subject: | RE : [PEAR] [QuickForm] file upload and rules | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2763@lists.php.net to get a copy of this message | ||
My code :
----------
...
$form->addElement('text', 'username', 'Votre Pseudo');
$form = new HTML_QuickForm('inscription', 'POST',
$_SERVER['PHP_SELF']);
$form->addElement('file', 'photo', 'Votre photo');
$form->addRule('photo', 'La taille de votre photo ne doit pas excéder 30
ko', 'maxfilesize', 30720);
...
----------
It's work if I upload a file but if I don't upload a file, the rule work
and the form is not submit. I want apply the rule only if the user want
upload a file.
I hope you understand me (my english is not good...;))
Thank
Yann
-----Message d'origine-----
De : Bertrand Mansion [mailto:bmansion@mamasam.com]
Envoyé : mardi 19 novembre 2002 17:42
À : Yann (zebulon-fr); pear-general@lists.php.net
Objet : Re: [PEAR] [QuickForm] file upload and rules
<yann@zebulon-fr.com> wrote :
> Hi,
>
> I try to create a form whith a non require file upload.
>
> My problem is that the rules for file upload (for just testing the
> file
> size) works even if the user doesn't want upload a file. What is the
> solution ?
>
> Thanks
>
> Yann
> PS ; sorry for my bad english
Can you please post your code with the rules options so that I can test
it. Thanks,
Bertrand Mansion
Mamasam