[Owncloud] Problems when sharing large files

Robin Appelman icewind at owncloud.com
Tue Mar 13 14:26:13 UTC 2012


On Tuesday 13 March 2012 15:22:01 Christian Schneider wrote:
> Hi all.
> 
> Using ownCloud 3.0, I experienced problems when trying to share large
> files globally. The Web server just returned a 500, the Apache log
> revealed the underlying problem:
> 
> [Tue Mar 13 14:29:00 2012] [error] [client ...] PHP Fatal error:
> Allowed memory size of 134217728 bytes exhausted (tried to allocate
> 381095937 bytes) in /var/www/owncloud-3.0.0/lib/filestorage/local.php on
> line 62
> 
> It turns out that this is a common problem witn PHP's readfile()
> function, and the best way to handle it is to read the file in chunks.
> So I patched the local.php file, see attached. This approach works fine
> for me with small files (< $chunksize) and large files
> (380 MB). Maybe you might consider merging this into the master branch.
> 
> Doing a quick grep through the source code, it seems that there exists
> the exact same problem in lib/filestorage/remote.php, but I don't know
> how and when the OC_Filestorage_Remote class is used and if it might
> ever happen that the remote file size will exceed the memory limit.
> 
> -Christian

This problem is already solved in master

 - Robin Appelman



More information about the Owncloud mailing list