public function get_file_size($file_path, $clear_stat_cache = false) {
        if(substr($file_path, 0, 5) === 's3://') {
            // for s3 object path
            // you could use this approach only with AWS SDK version >= 3.18.0
            // @see https://github.com/aws/aws-sdk-php/issues/963 for details
            return strval(filesize($file_path));
        } else {
            // for local path (thumbnails e.g.)
            return parent::get_file_size($file_path, $clear_stat_cache);
        }
    }
public function get_file_size($file_path, $clear_stat_cache = false) {
        if(substr($file_path, 0, 5) === 's3://') {
            // for s3 object path
            // you could use this approach only with AWS SDK version >= 3.18.0
            // @see https://github.com/aws/aws-sdk-php/issues/963 for details
            return strval(filesize($file_path));
        } else {
            // for local path (thumbnails e.g.)
            return parent::get_file_size($file_path, $clear_stat_cache);
        }
    }
public function get_file_size ( $ file_path , $ clear_stat_cache = false ) { if ( substr ( $ file_path , 0 , 5 ) === 's3://' ) { // for s3 object path // you could use this approach only with AWS SDK version >= 3.18.0 // @see https://github.com/aws/aws-sdk-php/issues/963 for details return strval ( filesize ( $ file_path ) ) ; } else { // for local path (thumbnails e.g.) return parent :: get_file_size ( $ file_path , $ clear_stat_cache ) ; } }
Retrieves file size
@param string $file_path
@param bool $clear_stat_cache
@return int|string
Retrieves file size