5

Get an error message when trying to add product image

enter image description herehttp://i.stack.imgur.com/BUHAk.png

  • 1
    Check file permissions on media folder (775 for directory and 664 for files) – Anna Völkl Mar 9 '16 at 11:50
  • set permissions on media folder.. but still getting the same error :( – Sruthi Mar 10 '16 at 6:11
  • 1.) Did it work before? 2.) What did you change before it stopped working? Please update your question with some more information. – Anna Völkl Mar 10 '16 at 7:21
  • i have changed permission on media folder.. then upload image to a product.. but its getting the same error[see screenshot] – Sruthi Mar 10 '16 at 9:00
  • plz help me to solve this issue.. :( – Sruthi Mar 16 '16 at 11:28
2

I also encountered in the same issue when I installed magento with php 7 during the analysis I came to know the issue was coming through below file ;

E:\Xampp7\htdocs\magento19\lib\Varien\File\Uploader.php:274 Uncaught Error: Function name must be a string in

To resolve this issue just replace below code:

At Line 274: $params['object']->$params['method']($this->_file['tmp_name']);

to

$params['object']->{$params['method']}($this->_file['tmp_name']);
1

Open file : /public_html/lib/Varien/File/Uploader.php

Find: (line: 272)

//run validate callbacks

foreach ($this->_validateCallbacks as $params) {
            if (is_object($params['object']) && method_exists($params['object'], $params['method'])) {
                $params['object']->$params['method']($this->_file['tmp_name']);

            }
        }

And Replace:

//run validate callbacks

foreach ($this->_validateCallbacks as $params) {
            if (is_object($params['object']) && method_exists($params['object'], $params['method'])) {
                $params['object']->{$params['method']}($this->_file['tmp_name']);
            }
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.