Hi, I encountered a problem with zipping by PclTar. I downloaded PclTar from its website, edit something to make it work. Now it make perfect tar and tgz file on my PC (Windows XP). But when upload to my web server, an problem occured: When zipping (tar or tgz), it create a big big big file. For example: a directory about 174 KB, when zip with PclZip about 29KB, but with PclTar (mode tgz), it take 902 KB!!! Plz help me. Here's the PclTar set: http://www.bossftp.com/boss/file/file.zip And the PHP code I used: <?php include('file/pcltar.php'); PclTarCreate('file.tgz', 'file', 'tgz'); ?> PHP: at http://www.bossftp.com/boss/test.php (deleted) Thank you.
Thanks Kaizoku, Your code work!, but I need a php code that don't use exec, which most web server disable. I tried downloading my tgz file, and open it with WinRAR. It show me many many file with the same name (duplicate file), eg. about 30 file named file.gif in one dir I don't know what the problem is. Plz help me.
I don't trust shareware like winrar, try using open source like 7zip, it supports all of winrar supports and many more like .7z, which is more superior. As for php version, if your host has zlib compiled in php, use http://www.phpclasses.org/browse/package/529.html
Let's not get ahead of ourselves when regarding 7zip. It's nice, but it can't pack .rar files. WinRar is commercial - granted, but written by the original developer of the .rar format, so it does exactly what you want... Just a shame he won't make the packing method open-source. (currently proprietary.) Dan
Thanks Kaizoku, I've download tar.class.php and use it. In fact, it doesn't have func to add a directory recursively, and I made one for it Now i can create tar and tgz file, thanks alot; but I can't extract them I tried tar.class.php, archive.php and EasyArchive.class.php (download from phpclasses.org), but none of them works. Can you help me? (tgz and tar file created by tar.class.php can be extracted with WinRAR.) Thank you very much!
Thank Kaizoku, After edit some code of EasyArchive, I can create and extract Tar file Thank you very much. @others: I'm saying about tarring a file with PHP