diff --git a/src/Services/FileService.php b/src/Services/FileService.php index d0c3dbbc..8a0eb3ba 100644 --- a/src/Services/FileService.php +++ b/src/Services/FileService.php @@ -112,7 +112,7 @@ class FileService while (!feof($srcHandle)) { $buffer = fread($srcHandle, 4 * 1024); - if ($maxBytes !== null and ftell($dstHandle) > $maxBytes) + if ($maxBytes !== null and strlen($result) > $maxBytes) { throw new \Exception( 'File is too big (maximum size: %s)',