Downloads not working properly for large files


Hey community,
since I am new to owncloud I dunno how I can provide more information you might need. So this is all I got:

I am able to upload files to my raspberryPi running owncloud. I mean its not giving any errors and I see their proper filesize. But when I want to download them via the WebInterface the download starts and finishes in like 0.5 seconds. The actual file size of the downloaded file is 0 Bytes.

I am running owncloud 10.4 version on a raspberryPi 3B
Everything is running fine except the downloading of large files.
Files bigger than around 2 GB fail to download. It doesnt matter which file type.

Hope someone can help me.

Greetings from germany



You need to adjust the timeouts in the php.ini file.

I think you are getting those timeouts and the download stops.


Hey dmitry, thank you for your post. I already tried this fix before.
I finally got into the owncloud thing and had a look at the logs.
Logs say that a php file had a bad line.
Maybe I am not the only one so let me explain it:

The log said:

"message":"stream_copy_to_stream() expects parameter 3 to be integer , string given at \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/http\/lib\/Sapi.php#78"

I found the following code not doing what it should:

$contentLength = $response->getHeader('Content-Length');
if ($contentLength !== null) {
$output = fopen('php://output', 'wb');
if (is_resource($body) && get_resource_type($body) == 'stream') {
stream_copy_to_stream($body, $output, $contentLength);

contentLength migh not be an integer, so I converted it via this command to an integer:

$contentLength = intval($contentLength);

Eh voila, all downloads are working right now.


Thank you for your reply, I am glad that it works for you.