Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function validateUploadFile($filePath) {
- $maxDimension = Mage::getStoreConfig(self::XML_NODE_PRODUCT_MAX_DIMENSION);
- $imageInfo = getimagesize($filePath);
- if (!$imageInfo) {
- Mage::throwException($this->__('Disallowed file type.'));
- }
- if ($imageInfo[0] > $maxDimension || $imageInfo[1] > $maxDimension) {
- Mage::throwException($this->__('Disalollowed file format.'));
- }
- $_processor = new Varien_Image($filePath);
- return $_processor->getMimeType() !== null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement