QuickForm 3.2 file upload bug?
| From: | Tim Glen | Date: | Mon, 08 Dec 2003 18:37:39 +0000 |
| Subject: | QuickForm 3.2 file upload bug? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9378@lists.php.net to get a copy of this message | ||
I updated to QuickForm 3.2 a couple days ago and just noticed something strange on one of my pages. When I was uploading a file, QuickForm wasn't seeing it. It existed in the $_FILES array but it wasn't being set as the value for the file object. Testing for upload using $upload_file->isUploadedFile(); returned false.
After some testing and trying, I found that it made a difference how I created the element:
// this doesn't work
$upload_file = &HTML_QuickForm::createElement('file', 'the_file', 'upload file');
$form->addElement($upload_file);
// this works
$form->addElement('file', 'the_file', 'upload file');
$upload_file = $form->getElement('the_file');
When I create the field statically, the field gets created properly, but the _value isn't being set properly inside the file class. When I do it the second way, everything works fine.
can anyone else verify this?
tim
--
tim glen
new media developer
nonfiction studios inc.
http://www.nonfiction.ca/