[pmwiki-users] Problem with indirect download of large files

Daniel Scheibler scheibi at gmail.com
Wed Nov 9 12:36:02 CST 2005

Hello Patrick,

2005/11/9, Patrick R. Michaud <pmichaud at pobox.com>:
> On Fri, Nov 04, 2005 at 01:35:46PM +0100, Daniel Scheibler wrote:
> > Hello,
> >
> > I detect a little problem with indirect downloads.
> >
> > I uploaded a large file (>50 MB), maybe xyz.zip,  via ftp into the
> > upload directory of a wiki page. Then I write Attach:xyz.zip into this
> > wiki page.
> >
> > Clicking the resulting link cause a error message in my webserver log file like:
> > PHP Fatal error:  Allowed memory size of 16777216 bytes exhausted
> > (tried to allocate 10240 bytes) in /path/to/pmwiki/scripts/upload.php
> > on line 169
> There are times when PHP really stinks.  Apparently PHP's readfile
> function is reading the entire attachment file into memory before
> sending it to the browser.  This is horribly wasteful of memory and
> system resources (and, as you've discovered, it breaks when the
> file size exceeds the memory limit).

I think although.

> I'll rewrite PmWiki to read and send the file in smaller chunks,
> which will resolve this problem.

Reads as a good solution.


Daniel Scheibler     ========:}       student at
eMail: scheibi at gmail.com           BTU Cottbus/Germany
WWW:   http://www.scheiby.de

More information about the pmwiki-users mailing list