Login   Register  
PHP Classes
elePHPant
Icontem

File: testDownload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Olavo Alexandrino  >  Easy Download  >  testDownload.php  >  Download  
File: testDownload.php
Role: Example script
Content type: text/plain
Description: Test of Class
Class: Easy Download
Serve a file for download with a PHP script
Author: By
Last change: Added include file
Date: 2004-05-11 06:27
Size: 545 bytes
 

Contents

Class file image Download
<?php
include("EasyDownload.php");


// path example
$myPath "/home/client/www/site1/folderDownload/";

// New Object
$objDownload = new EasyDownload();

// Set physical path
$objDownload->setPath($myPath);

// Set file name on the server (real full name)
$objDownload->setFileName($_GET["file"]);

// In case that it does not desire to effect download with original name.  
// It configures the alternative name
$objDownload->setFileNameDown($_GET["fileName"] . $_GET["extension"]);

// get file
$objDownload->Send();
?>