Current location: Hot Scripts Forums » Programming Languages » PHP » Creating a Zip file with PHP


Creating a Zip file with PHP

Reply
  #1 (permalink)  
Old 06-30-04, 10:20 PM
dannyallen dannyallen is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Creating a Zip file with PHP

Can someone explain to me about how to make a Zip file using PHP? I only need to put in a few files into the ZIP before it is created in the PHP, but I do need to put files created from the PHP into the Zip created by the PHP.
Reply With Quote
  #2 (permalink)  
Old 07-01-04, 01:38 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hello,

Did you mean gzip? If so, you can find a good explanation here:

http://ca2.php.net/manual/en/ref.zlib.php

It should be straightforward, but note that you need to compile PHP with zlib library.

As for pkzip, officially, PHP supports reading only, it seems like:

http://ca2.php.net/manual/en/ref.zip.php

But pay attention to the comments on the above page - someone offers a library to create one, too. BUT I have never even tried reading pkzip files with PHP, so I cannot comment further nor be responsible for whatever you do with it.

Hope this helps.
__________________
Blavv =|
Reply With Quote
  #3 (permalink)  
Old 07-01-04, 06:28 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
You also might want to check out phpzip at:

http://www.phpconcept.net/phpzip/index.en.php

Quote:
PhpZip is an application which creates archives and extracte files in several archive formats. Formats are the standard GNU TAR and the ZIP.
Reply With Quote
  #4 (permalink)  
Old 07-01-04, 08:47 AM
infinitylimit's Avatar
infinitylimit infinitylimit is offline
Code Guru
 
Join Date: Jun 2004
Location: Oregon
Posts: 758
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah with what blaw said you probably want to use tar/gzip anyway. Winzip supports this as well as stuffit expander, and it's native to *nix machines so that covers all your basis.
__________________
Hawk Enterprises -- Home to PHP games, open-source code, tutorials and free downloads
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 04:03 AM
PHP write to text file veeco Script Requests 2 02-10-10 02:48 PM
PHP code on a remote file tonniar .rm PHP 2 05-24-04 02:32 AM
compare the contents of 2 file in php rani PHP 5 04-14-04 11:47 PM
Creating a 666 file? tsb PHP 11 02-09-04 03:12 PM


All times are GMT -5. The time now is 05:07 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.