I'm trying to create a folder compressed with php at the moment it adds a single file but the idea is to be dynamic.
function crear_zip($id_paciente){
$files = array( 'C:\xampp\htdocs\bitnami.txt' );
$zipname = 'C:\xampp\htdocs\zipped_file.zip';
$zip = new ZipArchive;
$zip->open($zipname, ZipArchive::CREATE);
foreach ($files as $file) {
$zip->addFile($file);
}
$zip->close();
}
The problem is that in the .zip it is a copy of the path I gave it and not the file try giving it only the name of the file but apparently it does not find it and does not create the .zip .. idea? .. Thanks in advance