QuickForm file element uploading issue
| From: | Alexander F . Payne | Date: | Tue, 01 Jun 2004 19:52:10 +0000 |
| Subject: | QuickForm file element uploading issue | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12818@lists.php.net to get a copy of this message | ||
In trying to use HTML::QuickForm I'm running into an issue previously discussed on this list. In the function I have set up to process my QuickForm-based file upload form I do the following:
global $file;
if ($file->isUploadedFile()) {
$file->moveUploadedFile('uploads');
} else {
print "No file uploaded";} Other posts to this list indicate that defining $file globally will work if $file is defined in the QuickForm display function: $file =& $form->addElement('file', 'filename', 'File:'); However, when I try to upload files using this code I get the following error: Fatal error: Call to a member function on a non-object in /Library/WebServer/Documents/publications.php on line 161 I'm running PHP 5, if that makes any difference. Thoughts? ------------------------------------ Alexander F. Payne PICnet, Inc. - http://www.picnet.net 1341 G St., NW, Suite 1100 Washington, DC 20005 PH: 202.585.0232 FX: 202.393.0712