"Download all files" fails in NextCloudPi

Nextcloud version : 20.0.9
Operating system and version : RaspbianOS Lite (Latest)
Apache or nginx version : Apache/2.4.38 (Raspbian)
PHP version : 7.3.27

The issue you are facing:
When external users (non-logged) clicks on “Download all files” on the shared folder it fails and shows an external server error!
I installed NextCloud with NextCloudPi and hosted it in my Raspberry Pi4.

Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details
Remote Address: 1.1.1.1
Request ID: YI3a6eVF1GUJmpK1-FB2BQAAFQU

Here, “1.1.1.1” is my local gateway. I mean, router login address.

Is this the first time you’ve seen this error? : Yes

The output of your Nextcloud log in Admin > Logging:

    [index] Error: Exception: Argument 2 passed to OC\Streamer::__construct() must be of the type int, float given, called in /var/www/nextcloud/lib/private/legacy/OC_Files.php on line 164 at <<closure>>

    0. /var/www/nextcloud/lib/private/AppFramework/App.php line 152
       OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sharin ... {}, "downloadShare")
    1. /var/www/nextcloud/lib/private/Route/Router.php line 309
       OC\AppFramework\App::main("OCA\\Files_Shar ... r", "downloadShare", OC\AppFramework\ ... {}, {token: "naRyG2R ... "})
    2. /var/www/nextcloud/lib/base.php line 1008
       OC\Route\Router->match("/s/naRyG2RLRBQqWCS/download")
    3. /var/www/nextcloud/index.php line 37
       OC::handleRequest()

    GET /s/naRyG2RLRBQqWCS/download
    from 1.1.1.1 at 2021-05-01T22:08:58+00:00

I’m very new to NextCloud. Cloud you guys please, help me to solve this issue?

Can you access Nextcloud, and download files, from inside your network?
Did you forward ports 80 and 443 on your router to your RPI ?
Do you have a terminal attached or ssh enabled?

I solved the issue by editing Streamer.php file located in “/lib/private/Streamer.php”.

Find this line:

public function __construct(IRequest $request, int $size, int $numberOfFiles){

Replaced with:

public function __construct(IRequest $request, $size, int $numberOfFiles){

Worked for me!
Now, I can “Download all files” from shared folder easily without any “Internal Server Error”.