How to Change Media Image Directory Path

mediaproduct-images

I know it's not recommended but I want to upload product images to any folder in my web server's root directory instead of magento's media folder.

<upload_dir config="system/filesystem/media" scope_info="1">sales/store/logo</upload_dir>

The base image upload path is set with the config attribute (system/filesystem/media above).
I've updated system config value Base Media URL to http::/127.0.0.1/external.
But I don't see my product images being saved in http::/127.0.0.1/external folder once image is uploaded and product is saved.

Can anyone share where is the actual upload image code present? I've checked in Mage_Catalog_Model_Product_Attribute_Backend_Media::addImage() by doing Mage::log() but I think this function is not being called?

Best Answer

The easiest way to do this is to symlink the media directory or the corresponding subfolder to another location on disk:

ln -s media/catalog/product/ /mnt/my/huge/fileserver/location

Related Topic