List contents of zip file on server

by MD on 2009/11/01

To see contents of a zip file on server, you can use following script

open('xyz.zip') !== TRUE) {
    die ("Could not open archive");
}

// get number of files in archive
$numFiles = $zip->numFiles;

// iterate over file list
// print details of each file
for ($x=0; $xstatIndex($x);
	echo "";
    printf("%s (%d bytes)", $file['name'], $file['size']);
    print "
";
}

// close archive
$zip->close();
?>

You may also like:

Leave a Comment

Previous post:

Next post: