I was just working on image upload in magento and was unable to change the path of image up loader in WYSIWYG editor. After digg into code i found the solution and now i am posting here.
There is file in magneto core to deal with WYSIWYG editor on the location
“/app/code/core/Mage/Cms/Helper/Wysiwyg”
download a copy of the file as we need to change in it and have to upload in local area of magento (you don’t know where the local code business deal in magento? take a look 😉 not here 😛 google it);
on line 64 is a function definition getStorageRoot() , we need to change that function according to our requirement
/** * Images Storage root directory * * @return string */ public function getStorageRoot() { return Mage::getConfig()->getOptions()->getMediaDir() . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY . DS; }
change it to
/** * Images Storage root directory * * @return string */ public function getStorageRoot() { return Mage::getConfig()->getOptions()->getMediaDir() . DS . "cmsimages" . DS; }
upload to local area (you know what i mean :P)
” /app/code/local/Mage/Cms/Helper/Wysiwyg”
Ok , it is now working fine if there is a folder on the location ” http://yourdomain.com/media/cmsimages/ ” and if it is writable.
ooops is it long method ?? Yes?? we can do it shortly by editing the module file of magento for WYSIWYG config file 😛
just eidt the file “Config.php” on th location “/app/code/core/Mage/Cms/Model/Wysiwyg” on line number 54
/** * constant for image directory */ const IMAGE_DIRECTORY = 'wysiwyg'; /**
make sure folder must be exist in you magento media folder and have written permission to work, have FUN