Re: QuickForm - missing $_FILES data

From: Date: Fri, 04 Apr 2003 18:45:58 +0000
Subject: Re: QuickForm - missing $_FILES data
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4651@lists.php.net to get a copy of this message
Try using: $_FILES['quickformname']['name']; - Charles On Friday, April 4, 2003, at 12:51 PM, Branden Faulls wrote:
Trying to use Quickform as part of an image upload script. When I try to access the uploaded file in the $_FILES array, it is always empty. Using a simple form of my own, I am able to access the $_FILES data without fail. var_dump($_FILES); with a QuickForm returns nothing. Do I have to reinstatiate the same QuickForm inorder to process the form data? The Quickform source code doesn't point to this. Very confused here. Sample Code ----------------------------------------- <?php require_once('myAuth.php'); //an instantiation of Auth require_once('HTML/QuickForm.php'); //if myAuth.php finds the user is authenticated // it will call this function function page_content() { if(!$_FILES['imgfile']) {
    upload_form('No file uploaded!');
} else {
    /*********************************************
     * validate the image
     ********************************************/
} } //no post data, show form function upload_form($errMsg) { $page = new HTML_Page(); $form = new HTML_QuickForm('img_upl', 'post'); $img = &HTML_QuickForm::createElement('file','imgfile'); $smb = &HTML_QuickForm::createElement('submit', null, 'Submit'); $form->addHeader('Enter image to upload:'); $form->addElement($img); $form->addElement($smb); $page->body = ""; if(!empty($errMsg)){ $page->body .= "Errors were encountered uploading your file:<br>"; $page->body .= $errMsg; $page->body .= "Please try again.<br>"; } $page->body = $form->toHtml(); $page->display(); } ?> ----------------------------------------- Versions ----------------------------------------- PHP - 4.1.2 Apache - 1.3.26 PEAR - 1.0.1 HTML_Quickform - 2.10 ----------------------------------------- Any help would be appreciated. Thanks Branden -- +-----------------------------omphe.com-+
|                                       |
|Branden Faulls                         |
|                                       |
|                        www.omphe.com  |
|              brandenfaulls@omphe.com  |
|                   (+44) 773 440 8623  |
+---------------------------------------+ -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.general (#4651) next »