-2

the code below is working in localhost, but not working in server.

$zip = new ZipArchive();
$zip_name = $_POST['zip_category_name'] . $student_id . ".zip";
$zip->open($zip_name, ZipArchive::CREATE);
$res = $academicObj->get_files_by_category($_POST['download_files_zip']);
while ($row = mysqli_fetch_array($res)) {
    if (file_exists($row['path'] . $row['file'])) {
        $zip->addFromString(basename($row['doc_name']), file_get_contents($row['path'] . $row['file']));
    }
}
if ($zip->numFiles > 0) {
    echo $zip_name;
}
$zip->close(); 

No issue with write permission my server PHP Version is 7.2.32. please help....

meewog
  • 1,690
  • 1
  • 22
  • 26
Anvin
  • 49
  • 8

1 Answers1

0

the plugin for zip archive was missing. i found it by checking using calss_exist() function. thank you for helping

Anvin
  • 49
  • 8