/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
try { $uploader = new Varien_File_Uploader('logo'); $uploader->setAllowRenameFiles(false); $uploader->setFilesDispersion(false); $path = Mage::getBaseDir('media') . DS; // $path = Mage::getBaseDir('media') . DS . 'logo' . DS; $logoName = $_FILES['logo']['name']; $uploader->save($path, $logoName); } catch (Exception $e) { } }
URL: http://blog.chapagain.com.np/magento-how-to-upload-file/