Back to PhocaGalleryFile class

Method getFileSize

public static
getFileSize
(mixed $filename, mixed $readable = 1)

Method getFileSize - Source code

public static function getFileSize($filename, $readable = 1)
{
    $path = PhocaGalleryPath::getPath();
    $fileNameAbs = Path::clean($path->image_abs . $filename);
    if (!File::exists($fileNameAbs)) {
        $fileNameAbs = $path->image_abs_front . 'phoca_thumb_l_no_image.png';
    }
    if ($readable == 1) {
        return PhocaGalleryFile::getFileSizeReadable(filesize($fileNameAbs));
    } else {
        return filesize($fileNameAbs);
    }
}