Download class


Download class is file serve script with resume support and possibility to set download speed.
If You found a bug, You can send mail to kami.eper@gmail.com.

Download public functions:
new Download($file);initialize the class
rename($new_name);change file name to new name in browser or download manager
mime($mime_type);user defined mime type if file data is stored in database
resume();add resume support
speed();set maximum download speed
start();start the download
log($dir, $maxMB);log to directory with optionally maxMB logfile size
error();returns error message or FALSE if file is served


Download requirements:
php 4.0


Example Download call file
<?php
        include('includes/Download.class.php');
        
        $serve=new Download('filename.ext');
        //$serve->rename('filename.ext');
        //$serve->mime('application/pdf');
        $serve->resume();
        $serve->speed(256);
		//$serve->log('temp/');
        $serve->start();
        if ($serve->error)	echo $serve->error;
        unset($serve);
?>