12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /*
- * This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- $file = '/tmp/cv.tar';
- $json = '/tmp/json';
- try {
- $a = new PharData($file);
- file_put_contents ($json, $_POST['json']);
- $a->addFile('../cv.html', 'cv/cv.html');
- $a->addFile('../demo.html', 'cv/demo.html');
- $a->addFile('../js/cv.js', 'cv/js/cv.js');
- $a->addFile('../cvgen.html', 'cv/cvgen.html');
- $a->addFile('../js/reglages.js', 'cv/js/reglages.js');
- $a->addFile('../js/cvgen.js', 'cv/js/cvgen.js');
- $a->addFile('../js/info.js', 'cv/js/info.js');
- $a->addFile('../js/content.js', 'cv/js/content.js');
-
-
-
- $a->addFile('../server/ping.php', 'cv/server/ping.php');
- $a->addFile('../server/archive.php', 'cv/server/archive.php');
- $a->addFile('../server/download.php', 'cv/server/download.php');
-
- $a->addFile('../js/bootstrap.min.js', 'cv/js/bootstrap.min.js');
- $a->addFile('../js/jquery.min.js', 'cv/js/jquery.min.js');
- $a->addFile('../js/trianglify.min.js', 'cv/js/trianglify.min.js');
- $a->addFile('../js/background.js', 'cv/js/background.js');
-
- $a->addFile('../css/bootstrap.min.css', 'cv/css/bootstrap.min.css');
- $a->addFile('../css/cv.css', 'cv/css/cv.css');
- $a->addFile('../css/cvgen.css', 'cv/css/cvgen.css');
-
- $a->addFile($json, 'cv/data/cv.json');
- $a->addFile('../README.md', 'cv/README.md');
-
-
- $a->addFile('../data/demo.json', 'cv/data/demo.json');
- $a->addFile('../icons/johndoe.jpg', 'cv/icons/johndoe.jpg');
- $a->addFile('../LICENSE', 'cv/LICENSE');
-
-
- $a->addFile($_FILES['uploadFileImage']['tmp_name'], $_POST['img']);
-
- $a->compress(Phar::GZ);
- } catch (Exception $e) {
- }
- $file= $file. ".gz";
- if (file_exists($file)) {
- $b64 = base64_encode(file_get_contents($file));
- header('Content-Description: File Transfer');
- header('Content-Type: application/x-tgz');
- header('Content-Disposition: attachment; filename='.basename($file));
- header('Content-Transfer-Encoding: binary');
- header('Content-Length: ' . /*filesize($file)*/ strlen($b64));
- ob_clean();
- flush();
-
- ob_get_clean();
- echo $b64;
- ob_end_flush();
-
- unlink($file);
- exit;
- }
- ?>
|