vinc Posted May 19, 2011 Share Posted May 19, 2011 Hi, I am designing a new seller profile page for my osCommerce site. I want to let the seller upload a profile picture. I am using the exact same code as in the Add Item functionality where we can add an image for the product. The code works perfectly there but it is failing on the Seller Profile page. Any pointers to what I am doing wrong? In the following code in the parse() function on the upload.php class file the $_FILES is not getting set but it does get set in the call from the AddItem page. if (isset($_FILES[$this->file])) { $file = array('name' => $_FILES[$this->file]['name'], 'type' => $_FILES[$this->file]['type'], 'size' => $_FILES[$this->file]['size'], 'tmp_name' => $_FILES[$this->file]['tmp_name']); } elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) { global $HTTP_POST_FILES; $file = array('name' => $HTTP_POST_FILES[$this->file]['name'], 'type' => $HTTP_POST_FILES[$this->file]['type'], 'size' => $HTTP_POST_FILES[$this->file]['size'], 'tmp_name' => $HTTP_POST_FILES[$this->file]['tmp_name']); } else { $file = array('name' => (isset($GLOBALS[$this->file . '_name']) ? $GLOBALS[$this->file . '_name'] : ''), 'type' => (isset($GLOBALS[$this->file . '_type']) ? $GLOBALS[$this->file . '_type'] : ''), 'size' => (isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : ''), 'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : '')); } Link to comment Share on other sites More sharing options...
vinc Posted May 19, 2011 Author Share Posted May 19, 2011 thx for taking a look. I solved the issue. Had not declared the form object properly Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.