$uploader = new Varien_File_Uploader('fileinputname');
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
$uploader->setAllowRenameFiles(false);
$uploader->setFilesDispersion(false);
$path = Mage::getBaseDir('media') .DS. 'foo'.DS ;
if(!is_dir($path))
mkdir($path, 0777, true);
$uploader->save($path, $_FILES['fileinputname']['name']);
Saturday, December 19, 2015
Magento Image upload and set permission in custom module
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment