Unzipping a file from a remote server?

Discussion in 'PHP' started by tobydawson13, Nov 20, 2010.

  1. #1
    Hi there,
    Does anybody know how I can unzip a file from a remote server onto my server?
    I used to have a simple script to do this, but it seems I can't find it anymore.
    Thanks for you help :)
     
    tobydawson13, Nov 20, 2010 IP
  2. namduong8889

    namduong8889 Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this... i tested on my server and it works. your php must have the right to exec shell commands.

    
    <?php
    // put your file's url here
    $fileurl = 'http://ncu.dl.sourceforge.net/project/gate/gate/3.0/gate-3.0-build1846-DOC.zip'; 
     // download and unzip
    exec('wget ' . $fileurl . ';unzip ' . basename($fileurl));
    ?>
    
    PHP:
     
    namduong8889, Nov 21, 2010 IP
  3. tobydawson13

    tobydawson13 Active Member

    Messages:
    645
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Hmm, doesn't seem to work :/
     
    tobydawson13, Nov 21, 2010 IP
  4. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #4
    mfscripts, Nov 22, 2010 IP