From 7be4394f07c61f3d32d9e77b220b0c39cf89c0da Mon Sep 17 00:00:00 2001 From: Marc MAURICE Date: Fri, 3 Jun 2011 18:40:20 +0200 Subject: [PATCH] Added the tar plugin --- plugins/tar/after_content.php | 5 +++++ plugins/tar/tar.php | 45 +++++++++++++++++++++++++++++++++++++++++ template.php | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 plugins/tar/after_content.php create mode 100644 plugins/tar/tar.php diff --git a/plugins/tar/after_content.php b/plugins/tar/after_content.php new file mode 100644 index 0000000..8629df6 --- /dev/null +++ b/plugins/tar/after_content.php @@ -0,0 +1,5 @@ + +
+">Download all files in this directory +
+ diff --git a/plugins/tar/tar.php b/plugins/tar/tar.php new file mode 100644 index 0000000..9395e41 --- /dev/null +++ b/plugins/tar/tar.php @@ -0,0 +1,45 @@ +&1"); +preg_match('/^Total bytes written: ([0-9]+) /', $out, $matches); +$totalsize = $matches[1]; + +#$out = exec("du -c $filesarg"); +#preg_match('/^([0-9]+).*total$/', $out, $matches); +#$totalsize = $matches[1] * 1024; + +#var_dump($totalsize); + +#var_dump("tar --no-recursion -c $filesarg"); +#die(); + +header("Content-Length: $totalsize"); +header('Content-Type: application/x-tar'); +header('Content-Disposition: attachment; filename="'.basename($realDir).'.tar"'); + +passthru("tar --no-recursion -c $filesarg"); + +?> diff --git a/template.php b/template.php index 90ca799..34443c2 100644 --- a/template.php +++ b/template.php @@ -74,6 +74,8 @@ a {
">
+ +

Generated by Bizou

-- 1.7.10.4