Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    win zip command line in php

    I used the following code to unzip files using winzip command line, the command worked in the command window, but it didn't work in the code, it says that the file is unzipped but I can't see any thing...?


    Code:
    <?PHP
    $root ='c:\\';
    $unzipcmd = 'c:\>"c:\\program files\\winzip\\wzunzip" -d';
    
    function unzip($source,$target) {
             global $unzipcmd;
             if (file_exists($source)) {
                echo "unzipping $source to $target . . .<br>";
                $cmd = $unzipcmd.' '.$source.' '.$target;
                echo $cmd."<br>";
                system($cmd,$return);
                echo 'done. <BR>';
             }
             else return "File $source Not Found!<br>";
    }
    
        echo "<pre>".unzip($root."MyFile.zip","c:\\")."</pre>";
     echo $root."<BR>";
    ?>

  • #2
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    Hi:
    Please do not start a new thread when following up on an earlier question. You've already posted an identical response here: http://www.codingforums.com/showthread.php?t=37111

    Closing this thread.
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.


  •  

    Posting Permissions

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