Re: FormBuilder file uploads validation
| From: | Justin Patrin | Date: | Mon, 07 Aug 2006 15:16:14 +0000 |
| Subject: | Re: FormBuilder file uploads validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24851@lists.php.net to get a copy of this message | ||
On 8/7/06, alessandro pasotti <ale.pas@tiscali.it> wrote:
Hello, I've probably messed up something but I cannot understand why when DAO->validate() is called before insert or update the DO values for file fields are not filled. How could I validate a file name against a certain pattern? Say I want the user upload only files with .pdf extension (I know this is not a guarantee of having a PDF inside, but it's enough for now). Note that all non-file fields are corrected filled up with new submitted values.Well, files are different than other types of fields. They don't just pass data. You can always access $_FILES.
Thanks in advance. here is a stack trace:Perhaps you're calling process with false as its second parameter? I'm not *exactly* sure what will happen when you pass true, but the false it to keep files *out of* the form data.9 HTML_QuickForm->process() /home/www/SIGEdit.php:233 10 call_user_func () /usr/share/php/HTML/QuickForm.php:1601
11-- Justin PatrinDB_DataObject_FormBuilder->processForm() /usr/share/php/HTML/QuickForm.php:012DB_DataObject_FormBuilder->validateData() /usr/share/php/DB/DataObject/FormBuilder.php:262613SIGDAO_ANOMALIE->validate() /usr/share/php/DB/DataObject/FormBuilder.php:2462