PHP Classes
elePHPant
Icontem

Little Leach: Serve files protected from direct download

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2008-09-28 (6 years ago) RSS 2.0 feedNot enough user ratingsTotal: 429 All time: 5,832 This week: 1,275Up
Version License PHP version Categories  
little_leach 0.7GNU General Publi...5HTTP, PHP 5, Files and Folders
Description Author  

This class can be used to serve files protected from direct download.

It sets a session variable with the name of file that is made available for download from a page link.

The class can serve the file for download only if it is session variable is set, thus preventing that file be download directly without going to the page with the download link.

Picture of Andrey Nikishaev
Name: Andrey Nikishaev is available for providing paid consulting. Contact Andrey Nikishaev .
Classes: 13 packages by
Country: Ukraine Ukraine
Age: 29
All time rank: 2476 in Ukraine Ukraine
Week rank: 354 Down6 in Ukraine Ukraine Equal
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Details provided by the author  
- place .htaccess file to the directory which you want to lock
- pathes to the locked directorys must be writed from the server document root directory 

new leach($pathes) - creates Leach and give to him pathes of the directorys where it must search files.
leach->setAccess() - give access to the file. It write filename to the Session vars. So he know whether user goes to it throught direct link or not.
leach->getFile($filename,$dirname) - get's the file. Where filename - name of the file and dirname - name of the locked directory from the pathes array. If it null, Leach will search file in all listed directorys.
  Files folder image Files  
File Role Description
Accessible without login Plain text file getfile.php Example example
Accessible without login Plain text file leach.php Example example
Accessible without login Plain text file README.TXT Doc. Installation readme
Plain text file .htaccess Conf. file access for Apache
Accessible without login Plain text file little_leach.php Class class

 Version Control Unique User Downloads Download Rankings  
 0%Total:429All time:5,832
 This week:0This week:1,275Up