Results 1 to 7 of 7
  1. #1
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    Read Zip File
    I would like to read a zip file using php. The zip file actually contains a list of text files. I tried using the zip_open() function, but it appears that hostGator does not have it installed. Any other ideas?

  2. #2
    Full Member
    Join Date
    October 22nd, 2006
    Posts
    200
    Have you contacted support at hostgator requesting they implement it. The only other suggestion would be to change hosts.

  3. #3
    Full Member
    Join Date
    January 18th, 2005
    Posts
    396
    I run a small batch script using SSH on to my HostGator site - part of the batch script runs Unzip which is implemented in their Linux implementation

    Another (slightly messy way) is to shell out of your script - run Linux unzip and then return to your php script

    <?php
    $output = shell_exec('ls -lart');
    echo "<pre>$output</pre>";
    ?>
    substituting unzip xxx for ls -lart

    A sample from php.net

    Charles

  4. #4
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Hey Seymour,

    I have an account with Hostgator and I use gzopen() for zipped files. However, these are zipped data feeds. I don't see why it wouldn't work for your list of text files.

    Hope this helps.

  5. #5
    Full Member
    Join Date
    January 18th, 2005
    Posts
    396
    I wonder why hosting outfits (like HostGator) continue to use now obsolete software rather than updating ie: they use php4 which is no longer supported rather than installing php5xx. Is it that much trouble to update? So far I've not hit any compatibility problem with my scripts - knock on head - but I feel it coming

    Charles

  6. #6
    Newbie r2pro's Avatar
    Join Date
    January 23rd, 2008
    Location
    Baltimore
    Posts
    29
    Quote Originally Posted by micheck
    I wonder why hosting outfits (like HostGator) continue to use now obsolete software rather than updating ie: they use php4 which is no longer supported rather than installing php5xx.
    All Host Gator shared servers run PHP 5 & 4 concurrently. It's just a matter of modding your .htaccess file. If you have a dedicated server with them, put in a help ticket, and they'll switch you over. Search their support forum for more info on the subject.

    And as bettylou stated, you can indeed use the zlib extension of php to handle zipped files of any type. http://us2.php.net/manual/en/ref.zlib.php Your php instance must be configured to use zlib though. Your webhost can usually add this extension (or any other for that matter) for you, if it is not already configured.

    phpinfo(); will let you know what extensions are enabled in your php environment.

  7. #7
    ABW Ambassador Nature Boy's Avatar
    Join Date
    January 18th, 2005
    Location
    Tennessee
    Posts
    1,423
    I use this to unzip files on my Hostgator account:
    exec("unzip -o filename.zip");
    Scott
    If you can't dazzle them with brilliance, then baffle them with bulls#!t
    Don't tell me that you'll do it... SHOW ME.
    Just because everyone else is drinking it is no reason for me to drink the KOOL-AID.

  8. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. How to FTP and Import CJ datafeeds from the CJ Zip File...
    By Mr. Sal in forum Programming / Datafeeds / Tools
    Replies: 20
    Last Post: June 10th, 2009, 04:21 AM
  2. zip file datafeed file transfer into database
    By rahulcbr in forum Programming / Datafeeds / Tools
    Replies: 13
    Last Post: August 28th, 2007, 04:59 AM

Posting Permissions

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