As per php manual I have already enable php_zip.dll in the php.ini file and also check php_zip.dll in ext folder of php installation folders. It appears there. But While using code for zip it shows errors as below:
Fatal error: Class 'ZipArchive' not found in C:\inetpub\wwwroot\projectname\bulkdownload.php on line 9
Following is the code of bulk download.php
<?php
function zipFilesAndDownload($file_names,$archive_file_name,$file_path)
{
$zip = new ZipArchive();
//create the file and throw the error if unsuccessful
if ($zip->open($archive_file_name, ZIPARCHIVE::CREATE )!==TRUE) {
exit("cannot open <$archive_file_name>\n");
}
//add each files of $file_name array to archive
foreach($file_names as $files)
{
$zip->addFile($file_path.$files,$files);
}
$zip->close();
//then send the headers to foce download the zip file
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=$archive_file_name");
header("Pragma: no-cache");
header("Expires: 0");
readfile("$archive_file_name");
exit;
}
$file_array = $_GET['voice'];
$file_names = explode(';', $file_array);
$archive_file_name = "voicefile.zip";
$file_path = "d:/temp_file/voice/";
zipFilesAndDownload($file_names,$archive_file_name,$file_path);
?>