×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: userc865b
Added: Sep 28, 2017 3:43 PM
Views: 9
Tags: php
  1. <?php    
  2.  
  3. // PDF
  4.     header("Content-type:application/pdf");  
  5.     $contentToDownload =  $_SESSION['labelPDF']->Output ( "test.pdf", 'S' );
  6.     $contentToDownload =  $_SESSION['labelPDF'];
  7.  
  8.     header ( 'Content-Disposition: attachment;filename=Barcodelabel_' . $timestamp . '.pdf' );
  9.     echo $contentToDownload;
  10.     unset($_SESSION['labelPDF']);
  11.  
  12. //CSV
  13.         header("Content-type:application/csv");
  14.         $contentToDownload = $_SESSION['exportCSV'];
  15.         header ( 'Content-Disposition: attachment; filename=Export_' . $timestamp . '.csv' );
  16.         echo $contentToDownload;
  17.         unset($_SESSION['exportCSV']);