From f311c15dd4070f1ae770e94344e7848b4dbf5e73 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 1 May 2024 18:40:44 +0200 Subject: [PATCH] Slightly increase chunk size --- src/Api/Upload.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Api/Upload.php b/src/Api/Upload.php index 2f822be37b..31f03a1a08 100644 --- a/src/Api/Upload.php +++ b/src/Api/Upload.php @@ -30,7 +30,6 @@ public static function chunk( string $source, string $filename ): string|null { - ; // if the file is uploaded in chunks if ($isChunk = $api->requestHeaders('X-Upload-Chunk')) { // ensure the directory exists @@ -84,13 +83,13 @@ public static function chunkSize(): int Str::toBytes(ini_get('post_max_size')) ]; - //if server is behind a cloudflare proxy + // if server is behind a cloudflare proxy if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) === true) { $max[] = Str::toBytes('100M'); } - // to be sure, only use 90% of the max possible upload size - return (int)floor(min($max) * 0.9); + // to be sure, only use 95% of the max possible upload size + return (int)floor(min($max) * 0.95); } /**