Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unable to upload picture


vinc

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...