note 96811 added to function.ziparchive-addemptydir

From: Date: Wed, 17 Mar 2010 10:33:16 +0000
Subject: note 96811 added to function.ziparchive-addemptydir
Groups: php.notes 
Request: Send a blank email to php-notes+get-167126@lists.php.net to get a copy of this message
/* creates a compressed zip file */ function zipFilesAndDownload($file_names,$archive_file_name,$file_path){ //create the object $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; } ---- Server IP: 69.147.83.197 Probable Submitter: 122.162.101.142 ---- Manual Page -- http://www.php.net/manual/en/function.ziparchive-addemptydir.php Edit -- https://master.php.net/note/edit/96811 Del: integrated -- https://master.php.net/note/delete/96811/integrated Del: useless -- https://master.php.net/note/delete/96811/useless Del: bad code -- https://master.php.net/note/delete/96811/bad+code Del: spam -- https://master.php.net/note/delete/96811/spam Del: non-english -- https://master.php.net/note/delete/96811/non-english Del: in docs -- https://master.php.net/note/delete/96811/in+docs Del: other reasons-- https://master.php.net/note/delete/96811 Reject -- https://master.php.net/note/reject/96811 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167126) next »