public static function getMaxUploadSize($max_size = 0)
    {
        $post_max_size = Tools::unformatBytes(ini_get('post_max_size'));
        $upload_max_filesize = Tools::unformatBytes(ini_get('upload_max_filesize'));
        if ($max_size > 0) {
            $result = min($post_max_size, $upload_max_filesize, $max_size);
        } else {
            $result = min($post_max_size, $upload_max_filesize);
        }

        return $result;
    }