Back to PhocaDownloadLayout class

Method getFileSize

public
getFileSize
(mixed $filename)

Method getFileSize - Source code

public function getFileSize($filename)
{
    $size = '';
    if ($filename != '') {
        $absFile = str_replace('\\', '/', Path::clean($this->fileAbsPath . $filename));
        if (File::exists($absFile)) {
            $size = PhocaDownloadFile::getFileSizeReadable(filesize($absFile));
        } else {
            $size = '';
        }
    }
    return $size;
}