There are certain circumstances where it’s desirable to force files hosted on an Apache web server to download rather than rendering in the browser. This can be accomplished using the following .htaccess file… Continue reading
Tag Archives: php
Simple PHP script to Tar a folder
Leave a reply
Here it is…
<?php
$path = explode("/",realpath('./'));
$filename = date("Y-m-d_His") . "_" . array_pop($path);
echo "<pre>Compressing ./* to ../${filename}.tgz</pre>";
$output = shell_exec('tar -cvz --exclude "./dotar.php" -f ../' . $filename . '.tgz ./*');
echo "<pre>$output</pre>";
echo "<pre>Done.</pre>";
?>