Advertisement
krot

ZipArchive

Jul 18th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <? $FileNameZip=$_SERVER['DOCUMENT_ROOT']."/doc/{$idDoc}_cor.zip";
  2.                     $zip = new ZipArchive;
  3.          if ($zip->open($FileNameZip,ZipArchive::CREATE) === TRUE) {
  4.             $zip->addFile($FileNameCFCor,  iconv("UTF-8", "cp866",'Счёт-фактура-корректировочный '.$docDate.'.xls'));
  5.             $zip->close();
  6.            
  7.             header('Content-Type: application/zip');
  8.             header('Content-Disposition: attachment;filename="'.$idDoc.'-'.$docDate.'-корректировочный.zip"');
  9.             header('Cache-Control: max-age=0');
  10.             readfile($FileNameZip);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement