this makes sense now - this is due to this bug: http://trac.elgg.org/ticket/1932
Rather than splitting the string, you could echo the whole thing which will save a little memory. Though you are probably running into the problem that you cannot fit the file in memory. This code reads the entire file into memory before sending it to the user. That doesn't work so well on large files and needs to change.
Is there any solution to this?
Yes, the download code should read a chunk at a time before sending to the browser so that the entire file is not read into memory.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.