Problems with .zip files

Discussion in 'Web Design and Development' started by NYNick, Dec 9, 2009.

  1. NYNick macrumors newbie

    Joined:
    Jul 19, 2009
    #1
    I am developing modifications for SimpleMachines Forums (SMF), and am having problems. I've heard Macs add little bits of data when you compress a file, causing my packages not to work properly. This happens every time I compress a file into a Zip archive. I wondered if there was some sort of free software, some settings I can adjust, or some command I can run from the terminal to prevent this from happening, as it's really irritating not to be able to finish projects just because I run on a Mac (Leopard).

    Note that the people at SimpleMachines weren't sure either, so I figured I could ask here and possibly get an answer. Thanks

    ~Nick
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    I was not aware of any compatibility issues between PC zip and Stuffit.

    Since you didn't describe the specific error that occured, my advice for now will be quite simple. Did you know PHP supports ZIP (class ZipArchive), so regardless of the platform that created the zip file, PHP should be able to unzip it.

    Requirements here, i.e. I suggest PHP 5.2.0 or later. Example code:

    PHP:
    <?php
    $zip 
    = new ZipArchive;
    if (
    $zip->open('test.zip') === TRUE) {
        
    $zip->extractTo('/my/destination/dir/');
        
    $zip->close();
        echo 
    'ok';
    } else {
        echo 
    'failed';
    }
    ?>        
    Have you tried a simple test like that on both a PC and Mac zip file located on your server?

    -jim
     

Share This Page