if($_FILES['productimage']['name'] != ''){
$uploader = new Varien_File_Uploader('productimage');
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
$uploader->setAllowRenameFiles(false);
$uploader->setFilesDispersion(false);
$productimage = $_FILES['productimage']['name'];
$path = Mage::getBaseDir() . DS . 'directoryname1' . DS . 'directoryname2' . DS;
$uploader->save($path, $productimage);
}
No comments:
Post a Comment