problem with QuickForm file upload
| From: | Maarten Stolte | Date: | Mon, 25 Nov 2002 19:32:29 +0000 |
| Subject: | problem with QuickForm file upload | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-11085@lists.php.net to get a copy of this message | ||
Hello,
i'm trying to use the upload element of QuickForm, a cvs version of 3 weeks or so ago.
The form seems to function okish with mozilla, where i only have a problem that my regex to 'filter' out files with spaces etc doesnt work.
On internet explorer, it fails unless i remove the mimetype check.
Here is my code, anyone care to look at it?
$form->addRule('file', 'Cannot exceed 1 mb', 'maxfilesize', 1000000);
$form->addRule('file', 'Must be a jpeg', 'mimetype', array('image/jpeg'));
$form->addRule('file', 'Must be *.jpg', 'filename', '/^.*\.jpg$/');
$form->addRule('file', 'Filename may only contain A-Z, 0-9, \'_\' and \'.\'', 'filename','/[0-9ab\_]+/');
$form->addRule('file', 'File is required', 'uploadedfile');
regards,
Maarten