i am getting the following error:
PHP Warning: is_uploaded_file() expects parameter 1 to be string, object given.
i am getting in the aforementioned script. the code is as follows:
Code:
function parse() {
global $messageStack;
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] : ''));
}
if ( zen_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) ) {
the error happens on the last line.
i have tracked this error down to only happen when the if statement hits the last block. and therefore the line in question is:
Code:
'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : ''));
does that look correct?
its getting called by admin/includes/modules/new_product_preview.php
unfortunately i can not reproduce the error at will, as it's rather confusing as to when we would hit that 3rd block of code. i have tried with a numerous things in the image file.
any ideas?
thanks.
ps, at the time of the error, $file['tmp_name'] looks like:
Code:
(
[file] => products_image
[filename] =>
[destination] => /home/XXXXXX/XXXXXXX/images/
[permissions] => 420
[extensions] => Array
(
[0] => jpg
[1] => jpeg
[2] => gif
[3] => png
[4] => webp
[5] => flv
[6] => webm
[7] => ogg
)
[tmp_filename] =>
[message_location] => direct
)
Bookmarks