PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of David Passey   EPSDownload   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: demo file
Class: EPSDownload
Serve files for download
Author: By
Last change: Added instructions.
Date: 15 years ago
Size: 846 bytes
 

Contents

Class file image Download
<?php
/* To download a PDF document inline to the browser. */

   
require_once 'class.eps_download.inc';
   
       
$http = new EPSDownload($file);
   
$http->setContentType('application/pdf');
   
$http->setDescription('PDF Download');
   
$http->execute();
    unset(
$http);

/* To download a document as an attachemnt. */

   
require_once 'class.eps_download.inc';
   
       
$http = new EPSDownload($file,'attachment');
   
$http->setDescription('My Document');
   
$http->execute();
    unset(
$http);

/* To download a string value as a CSV file. */

   
require_once 'class.eps_download.inc';
   
       
$http = new EPSDownload('one,two,three,four,five','attachment',1);
   
$http->setContentType('application/x-excel');
   
$http->setDescription('Data Download');
       
$http->setDownloadName('data.csv');
   
$http->execute();
    unset(
$http);

?>