Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2008-08-21 07:59
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);

?>