PHP Classes

File: testDownload.php

Recommend this page to a friend!
  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: 19 years ago
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();
?>