Relative Content

Tag Archive for phpphp-ziparchive

downloaded zip with ZipArchive PHP which outputs strange strings

if (ob_get_length()) { ob_end_clean(); } $checkedValues = $img; $zipname = ‘file.zip’; $zip = new ZipArchive; // echo $zip.'<br>’; if ($zip->open($zipname, ZipArchive::CREATE) === TRUE) { echo $zipname.'<br>’; foreach ($checkedValues as $value) { if (file_exists($value)) { echo ‘Path: ‘ . htmlspecialchars($value) . ‘<br>’; echo ‘Path: ‘ . basename($value) . ‘<br>’; // $zip->addFile($value); $zip->addFromString(basename($value), file_get_contents($value)); } else { […]