I'm trying to create a zip file with a flat folder/file structure with PHP ZipArchive that contains two PDF files. So basically both files should be in the root of the zip file. I use the code below to create the zipfile.
$zip = new ZipArchive();
$zip_filename = "zipfile.zip";
if ($zip->open($zip_filename, ZipArchive::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFile("cover_file.pdf", "cover_file.pdf");
$zip->addFile("inlay_file.pdf", "cover_file.pdf");
$zip->close();
Whatever I do, the files are always placed inside a folder with the samen name as the zipfile.
Is there a way to save the files to the root of the zip file?
Thanks in advance!