Call Zipfile from Remote Server, and extract it.

Discussion in 'PHP' started by adbox, Feb 4, 2010.

  1. #1
    Hey guys,

    I am looking for an auto update solution for my software. I want to call a zip file from a remote server, download it, and then extract it's contents replacing old contents.

    Anyone have a solution for me?

    A total package would include a progress bar.

    I can also build this myself if I have the right leads.

    thanks!
    adbox
     
    adbox, Feb 4, 2010 IP
  2. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
  3. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Here's the extracting part
    <?
    $filename="some.zip";
    $url="http://www.somwhere.com/";
    $contents = file_get_contents($url);
    
    $zip = new ZipArchive;
    $zip->open($filename, ZIPARCHIVE::CREATE)
    $zip->extractTo('dirtoextract/');
    $zip->close(); 
    ?>
    Code (markup):
    its easier to use css for progress bar
     
    javaongsan, Feb 4, 2010 IP