I have the following code running for quite some time now:
$thisdir = "$_SERVER[DOCUMENT_ROOT]/webroot/uploads/user_uploaded_files/";
if( !empty( $files ) ){
$destination = 'uploads/zip_files/meeting_' . $meetingId .'.zip';
$zip = new ZipArchive();
$zip->open( $destination, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE );
//Add all the uploaded files ( $file = filename.ext )
foreach( $files as $file ){
if(file_exists( $thisdir . $file )){
$zip->addFile('/uploads/user_uploaded_files/' . $file, $file);
}
}
However, it had just recently stopped working (not sure of the previous, but current version is 7.0.9 ).
foreach loop runs as previously, file_exists
always returns true
, but no files are being added to the archive.
Did anyone experience that too? Any help or guidance is much appreciated.