public function formatFilesize($bytes)
    {
        $units = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');
        $level = floor(log($bytes)/log(1024));

        $output = sprintf('%.2f %s', ($bytes/pow(1024, floor($level))), $units[$level]);

        return $output;
    }