I am trying to add category programatically. Category got created very easily but i am not finding the way to add category image. here is my code.
$brand_name = $_POST['brand_name'];
$brand_logo = $_FILES['filename']['name'];
$brand_content = $_POST['brand_content'];
$brand_id = $_POST['brand_id'];
$brand_path = $brand_logo;
$parentId = '35';
$category = new Mage_Catalog_Model_Category();
$category->setName($brand_name);
$category->setUrlKey($brand_name);
$category->setIsActive(1);
$category->setDisplayMode('PRODUCTS');
$category->setIsAnchor(0);
$parentCategory = Mage::getModel('catalog/category')->load($parentId);
$category->setPath($parentCategory->getPath());
$data['display_mode'] = 'PRODUCTS_AND_PAGE';
$data['page_layout'] = 'one_column';
$data['thumbnail'] = $brand_path;
$category->addData($data);
$category->save();
unset($category);
Thanks in advance