If you check the XHR response in the debugger, you will see this {"error":"File was not uploaded.","errorcode":666}
This error comes from Varien_File_Uploader::__construct() in lib/Varien/File/Uploader.php
Here are the important parts
<?php class Varien_File_Uploader { protected $_file; const TMP_NAME_EMPTY = 666; function __construct($fileId) { $this->_setUploadFileId($fileId); if(!file_exists($this->_file['tmp_name'])) { $code = empty($this->_file['tmp_name']) ? self::TMP_NAME_EMPTY : 0; throw new Exception('File was not uploaded.', $code); } else { $this->_fileExists = true; } } }
Looking back, you see what it's called
$uploader = new Mage_Core_Model_File_Uploader('image');
which is extended from the Varien class, so Varien_File_Uploader::_setUploadFileId($fileId) will build the $this->_file array based on the image key. In this case.
So now the problem. Why is $_FILES['image']['tmp_name'] empty?
I checked the 'error' field by temporarily changing the exception to
throw new Exception('File was not uploaded. ' . $this->_file['error'], $code);
I got 7 , which Failed to write file to disk. , which means this is a permission issue. Do phpinfo() to check where your upload_tmp_dir installed and make sure it is writable.
In my case, I did not have the file space in the /tmp .
source share