6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
11/8/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#5913] Lower memory usage while downloading files
*
Your Email Address
*
Spam protection
Enter the letters below:
.___. .. ..__ ._. [__ \ /\ /[__) | [___ \/ \/ [__)_|_
Comment
> OK, lack of time prevented me from going further on this. > > Tried the modifications. It didn't work so I took a look at view.php > and modified it as follows: > > > > case 'download_file': > > $browser->downloadHeaders($filename, null, false, > $GLOBALS['gollem_vfs']->size($filedir, $filename)); > > if (is_resource($stream)) { > > while ($buffer = fread($stream, 10240)) { > > print $buffer; > > ob_flush(); flush(); > > usleep(50000); > > } > > } else { > > echo $data; > > } > > /* if (is_resource($stream)) { > > fpassthru($stream); > > } else { > > echo $data; > > } */ > > break; > > > > That works for me with 16MB memory_limit downloading a 61MB file. The > fpassthru still goggles up more memory than is desirable. ob_flush() > and flush() are nessary to clear internals of the webserver and php, > the usleep(50000) (.05 seconds) allows a bit of time for the buffers > to be actually flushed before filling them again. > > Hows that? > > > > Cheers! Olger.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers