Eğer bir hata ayıklayıcı XHR yanıtı kontrol ederseniz, göreceksiniz bu {"error":"File was not uploaded.","errorcode":666}
Bu hata Varien_File_Uploader::__construct() lib/Varien/File/Uploader.php in geliyor
Burada önemli parçalarıdır
<?php
class Varien_File_Uploader
{
/**
* Uploaded file handle (copy of $_FILES[] element)
*
* @var array
* @access protected
*/
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;
}
}
}
Bu denir görmek ağacın geri Looking
$uploader = new Mage_Core_Model_File_Uploader('image');
Varien sınıftan uzatılır, bu nedenle Varien_File_Uploader::_setUploadFileId($fileId), bu durumda anahtarın image göre $this->_file dizi oluşturmak hangi.
Şimdi sorunu why is $_FILES['image']['tmp_name'] boş? A>
Ben geçici olarak throw new Exception('File was not uploaded. ' . $this->_file['error'], $code); ile değiştirerek 'error' alanını kontrol
I Failed to write file to disk. Introduced in PHP 5.1.0. which means it's a permissions issue. Do a phpinfo() sizin upload_tmp_dir olarak ayarlandığı kontrol ve yazılabilir olduğundan emin olmak için, hangi 7 var.
Benim durumumda, ben /tmp Dir dosya alanı dışında oldu.