You are here: Zip on the fly « PHP Language « IT news, forums, messages
Zip on the fly

Posted by Anze on 10/11/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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация