3

I am getting the following error on uploading files in Magento admin.

Upload HTTP Error

I have added the following to my php.ini

upload_max_filesize = 200M
post_max_size = 200M
memory_limit = 512M

I have also added this to my nginx config

client_max_body_size 200m;

enter image description here

I have also toggled between https and http

  • Update adobe flash player. Check nginx error log. Global array $_FILES have field 'error' - check this field. Change browser. Try from mobile. – zhartaunik Apr 8 '15 at 14:15
2

If you are using PHP 7 then go to

lib/Varien/File/Uploader.php

Find the following code

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

And replace it with

$params['object']->{$params['method']}($this->_file['tmp_name']);
  • fixed it for me. running magento 1.9.2.1 with php 7.0.13 – Konstantin Gerasimov Dec 12 '16 at 13:13
  • worked mag v 1.9.2.4 PHP7.1.10 – Martin Oct 16 '17 at 15:02
1

The problem was the following:

php-fpm was running with the group www. the folder /var/lib/nginx was set to nginx:nginx

chown -R www-data:www /var/lib/nginx

Therefore I reset the owner on the folder to www-data:www and it works!

0

HTTP upload error: Such error is received due to 'n' number of reasons like folder permission, server PHP handler, etc and solutions for the same are easily available on the web.

But in my case, everything was fine but still, the issue was not resolved. Finally, the issue was found to be with .htaccess protection applied to the Magento website. The .htaccess protection should be disabled while image uploading. Not sure why Magento behaves like this but server admins will have to care of that.

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.