Posted by Anze on 11/27/12 11:28
Hi all!
I was using this code for a simple backup:
header("Content-type: application/x-tar");
header('Content-Disposition: inline; filename="b.tar"');
passthru('tar -cf - '.$dir);
The files are mostly JPEG/GIF/PNG images so I don't care about compression -
but there are many (even several hundred MB).
Then my provider decided that passthru() is not safe anymore.
I am now trying to do the same with some PHP classes, but the problem is
that every one of them builds the file on the disk or in the memory and
then serves it. I tried using ZipLib but it only works on small archives -
when I use it on more files the connection to the server gets broken very
quickly (with "memory exhausted" message in Apache error.log).
Is there a class that builds the archive and outputs it directly instead of
building it in the memory?
Any advice would be appreciated.
Kind regards,
Anze
[Back to original message]
|