小编典典
SomePage.php
download.php
$FileNo=$_GET['FileNO'];
//Use Mysql Query to find the 'full path' of file using $FileNo.
// I Assume $FilePaths as 'Full File Path'.
download_file($FilePaths);
function download_file( $fullPath )
{
if( headers_sent() )
die('Headers Sent');
if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');
if( file_exists($fullPath) )
{
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
switch ($ext)
{
case "pdf": $ctype="application/pdf"; break;
case "exe": $ct