/** * Get the properties of a file * * @param string $file : name of the file * @return array : array of properties */ public function getFileProperties($file) { $fileType = $this->getFileType($file); $fileSizeInBytes = filesize($file); $fileSize = (int) $fileSizeInBytes; $fileSize = Steelcode_File_Helper::sizeString($fileSize); $extension = Steelcode_Media_Helper::fileExtension($file); $fileModifiedTime = date('d M Y', filemtime($file)); return array('type' => $fileType === 'unknown' ? strtoupper($extension) . ' file' : ucfirst($fileType), 'size_as_string' => $fileSize, 'size_in_bytes' => $fileSizeInBytes, 'date_modified' => $fileModifiedTime); }