Glob files not working????
DoM1niC opened this issue · 1 comments
DoM1niC commented
normal Zip was working fine its only archive one file and this isnt extractable .... :(
PHP 8.0
$musicStuff = glob($globVar, GLOB_BRACE);
if (isset($_POST["action"])) {
$action = strtolower($_POST["action"]);
header('X-Accel-Buffering: no');
if ($action == "zip") {
$opt = new ZipStream\Option\Archive();
$opt->setSendHttpHeaders(true);
$opt->setContentDisposition('attachment');
$opt->setContentType('application/x-zip');
$opt->setEnableZip64(true);
$opt->setFlushOutput(false);
$opt->setStatFiles(true);
// create a new zipstream object
$zip = new ZipStream\ZipStream("$cur_dir2.zip", $opt);
foreach ($musicStuff as $file)
$zip->addFile(basename($file), file_get_contents($file));
$zip->finish();
}
}
DoM1niC commented
ob_end_clean();
fixed my issue