Some of the zip files is download but some files showing like "The requested URL /export/1286.zip was not found on this server."
But i am using the same code for both.
final_zip($certificate_id);
function final_zip($certificate_id){
$zip = new ZipArchive;
$zip_file=$certificate_name.'-licence-documents-'.date("d-m-Y h:i:s").'.zip';
if ($zip->open("$zip_file",ZipArchive::CREATE) === TRUE){
$q_pack="(select * from filename where cerid=$id)";
$res_pack = db_query($q_pack);
if ($res_pack){
$fp = fopen('Package_list.csv', 'w');
while ($pack_row = db_fetch_object($res_pack))
{fwrite($fp, "\n");
foreach ($pack_row as $line) {
$val = '"'.$line.'"'.',';
fwrite($fp, $val);}}
fclose($fp);
$zip->addFile('Package_list.csv', "Package list.csv");
}}$zip->close();
ob_get_clean();
header('Content-Type: application/zip');
header("Content-Disposition: attachment; filename=$zip_file");
header('Content-Length: ' . filesize($zip_file));
header("Location: $zip_file");}