PHP Classes

File: getfile.php

Recommend this page to a friend!
  Classes of Andrey Nikishaev   Little Leach   getfile.php   Download  
File: getfile.php
Role: Example script
Content type: text/plain
Description: example
Class: Little Leach
Serve files protected from direct download
Author: By
Last change: bugfix
Date: 15 years ago
Size: 663 bytes


Class file image Download

//pathes to the locked directorys starts from the server document root

$a=new Leach($pathes);
//$filename - it's the name of the file that Leach searchs in the locked directorys
if(!array_key_exists('leach', $_SESSION) || !in_array($filename,$_SESSION['leach'])) {
//setAccess method set access to the file.
echo "<h1>File Downloading Page:</h1>";
"<a href='leach.php?f=".$filename."'>Download</a>";
} else {
header('Location: leach.php?f='.$filename);