Location: PHPKode > scripts > MakeCAB > example.php
<?php
//Send the MSCAB MIME type
header("Content-Type: application/vnd.ms-cab-compressed");
//Make it an attachment
header('Content-Disposition: attachment; filename="test.cab"');
//include the class file
include("MakeCAB.class.php");
//create object
$cab = new MakeCAB("test.cab");
//add a local file system file
$cab->addfile("BuildingTradesProposal2.doc");
//add a file from a url
$cab->addurl("http://greaterfortwayne.net/favicon.ico");
//add all of the contents of a local file system directory, leaving the base directory
$cab->adddir("K:/xampp/htdocs/data/","data/");
//Make the file
$cab->WriteCAB();
//output the file
readfile("test.cab");
//delete the file
unlink("test.cab");
?>
Return current item: MakeCAB