I have been running for a long time and recently moved to a different server and upgraded to Magento 1.9 from 1.8. After the usual hickups everything seems to work, except for uploading images to products (and in the WYSIWYG editor).
Flash works and I can use the buttons to select the image, afterwards the uploading bar runs up to 100% and then the error "File was not uploaded." appears.
I have been looking for all possible problems and checked the following:
How to solve this problem? Or at least find the reason for its occurrence?
Edit the file lib/Varien/File/Uploader.php and add Mage::log()
inside the save() function.
public function save($destinationFolder, $newFileName = null)
{
$this->_validateFile();
if ($this->_allowCreateFolders) {
$this->_createDestinationFolder($destinationFolder);
}
if (!is_writable($destinationFolder)) {
Mage::log($destinationFolder);
throw new Exception('Destination folder is not writable or does not exists.');
}
}
or to another places in thic class and get exact error ... File will be saved at configured Magento exceptions and logs files folder.
please open your inspect Element(q) in Firefox or chrome and check console tab and if you find the error as "Uncaught Error: Function name must be a string in C:\\MAMP or wamp or xamp\\htdocs or www\\magento\\lib\\Varien\\File\\Uploader.php:259" then you can fix it from following solution.
-first you should open Uploader.php from C:\\MAMP or wamp or xamp\\htdocs or www\\magento\\lib\\Varien\\File\\Uploader.php and going to 259 line find this code
$params['object']->$params['method']($this->_file['tmp_name'])
and the change it to
$params['object']->{$params['method']}($this->_file['tmp_name']);
i just add {} around $params['method'] and it is work i think this error is come from changing your php version
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.