/** * Get image mime type * * @param string $pFile Filename * @return string Mime Type * @throws Exception */ private function _getImageMimeType($pFile = '') { if (Shared_File::file_exists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { throw new Exception("File {$pFile} does not exist"); } }
/** * Does a file support UnserializePHPExcel ? * * @param string $pFilename * @throws Exception * @return boolean */ public function fileSupportsUnserializePHPExcel($pFilename = '') { // Check if file exists if (!file_exists($pFilename)) { throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); } // File exists, does it contain phpexcel.xml? return Shared_File::file_exists("zip://{$pFilename}#phpexcel.xml"); }