-
-
Save jahvi/dff8e077b8cf7530a13a to your computer and use it in GitHub Desktop.
Change allowed file extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function changeAllowedFileExtensions(Varien_Event_Observer $observer) { | |
$file = $observer->getEvent()->getFile(); | |
// Add new '.mp4' file extension to the list | |
$allowedExtensions = $file->getData('allowed_extensions'); | |
$allowedExtensions[] = 'mp4'; | |
$file->setData('allowed_extensions', $allowedExtensions); | |
// Or, ignore default list and only allow '.pdf' files | |
$file->setData('allowed_extensions', array('pdf')); | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment