SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP zip using pack()

    Hi,

    I have read these articles on how to zip using the pack function:
    http://www.zend.com/zend/spotlight/c...zip-files1.php
    http://www.weberdev.com/get_example-4066.html

    These articles show how to zip files.
    But not how to read them. Also is it possible to gzip using pack().

    Is there a more complete library on zip and gzip using pack() (Not the PEAR lib)

    Thanks

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    At www.phpclasses.org there's a more complete class: http://www.phpclasses.org/browse/file/3191.html

    But unfortunately, there's no method included to extract zip-files.

    I've written a ZIP-class to create ZIP-files, and I managed to write a method to read a ZIP-file, and almost extract it.
    There's still one problem: when creating a ZIP-file, we remove the first two bytes of the encoded string (using gzipcompress). The first two bytes are always the same. Then we remove the last four bytes, that's the CRC.
    The problem is, I can't recalculate the CRC, and we need to append the CRC to the encoded string again to let gzuncompress decompress it.
    If someone has a solution to that, my extract method works.
    FOR SALE: 1 set of morals, never used, will sell cheap


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •