Location: PHPKode > projects > MyDB > webide/ffdownload.php
<?php
/*************************************************************
 * The MyDB librairy and applications are product of SQLFusion
 * It may be used and/or distributed under the terms of the Q Public
 * License (QPL) version 1.0, enclosed in the file licence.txt.
 ****************************************************************/
/** MyDB IDE Version 0.4    **/ 
/** Author Philippe Lewicki **/


/* Download the file */
set_time_limit(600);

         $conx = new mydataconnect;
         $conx->start(); 

 	$filename = stripslashes($filename); 
 	$filelocation = stripslashes($filelocation) ;           
	$contentype = stripslashes($contentype) ; 

        header("Content-disposition: filename=$filename");
       if (strlen($contentype)>0) {
	header("Content-type: $contentype"); 
        } else {
	header("Content-type: application/octetstream");
	}
	header("Pragma: no-cache");
	header("Expires: 0");	

               $fp = fopen($cfgHardLocation.$filelocation, "r"); 
               $contentfile = fread($fp, filesize($cfgHardLocation.$filelocation)) ; 
               fclose($fp); 
	echo $contentfile;                 	
?>
Return current item: MyDB