Page 1 of 1

PHP Zip Question

Posted: Mon Jun 08, 2009 2:20 pm
by Jason Curran
I'm trying to zip up the folder "website" as seen in the code below.

But when I open the Zip file, the files I am trying to Zip are 5 directories deep in the zip file. Does anyone know a way to have the zip file contain only the actual directory and not all of the directories in the path ?

Code: Select all

 
<?php
 
if (system('zip -r /home/path/to/my/website/newzipfile.zip 
                   /home/path/to/my/website')) {
                           
    echo '<p>It worked!</p>';
} else {
    echo '<p>It did NOT work!</p>';
} 
 
?>