| Server IP : 172.64.80.1 / Your IP : 172.71.120.135 Web Server : Apache System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 User : federalpolyede.edu.ng_idh35skikv ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/federalpolyede.edu.ng/httpdocs_backup/externalCall/ |
Upload File : |
<?php
//createZipFromDir('tempF2','signatures.zip');
//
//
//
//
//function Delete($path)
//{
// if (is_dir($path) === true)
// {
// $files = array_diff(scandir($path), array('.', '..'));
//
// foreach ($files as $file)
// {
// Delete(realpath($path) . '/' . $file);
// }
//
// return rmdir($path);
// }
//
// else if (is_file($path) === true)
// {
// return unlink($path);
// }
//
// return false;
//}
//
//function createZipFromDir($dir, $zip_file) {
// $zip = new ZipArchive;
// if (true !== $zip->open($zip_file, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)) {
// return false;
// }
// zipDir($dir, $zip);
// return $zip;
//}
//
//function zipDir($dir, $zip, $relative_path = DIRECTORY_SEPARATOR) {
// $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
// if ($handle = opendir($dir)) {
// while (false !== ($file = readdir($handle))) {
// if ($file === '.' || $file === '..') {
// continue;
// }
// if (is_file($dir . $file)) {
// $zip->addFile($dir . $file, $file);
// } elseif (is_dir($dir . $file)) {
// zipDir($dir . $file, $zip, $relative_path . $file);
// }
// }
// }
// closedir($handle);
//}
$file_url = 'signatures.zip';
header('Content-Type: application/zip');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url); // do the double-download-dance (dirty but worky)
?>