<?php 
$NewsImagePath = "../news/";

//echo $_REQUEST['file_name'];

$err ="";
// block any attempt to the filesystem
if (isset($_REQUEST['file_name'])) {
	$filename = $_REQUEST['file_name'];
} else {
	$filename = NULL;
}
if(isset($_REQUEST['ID']) && !empty($_REQUEST['ID']))
	$news_id = $_REQUEST['ID'];
else
	$news_id = NULL;	
	
if (!$filename) {
	// if variable $filename is NULL or false display the message
	echo $err;
} else {
	// define the path to your download folder plus assign the file name
	
	 $path = "../upload".'/'.$filename;
	
	// check that file exists and is readable
	if (file_exists($path) && is_readable($path)) {
	
	// get the file size and send the http headers
	$size = filesize($path);
	header('Content-Type: application/octet-stream');
	header('Content-Length: '.$size);
	header('Content-Disposition: attachment; filename='.$filename);
	header('Content-Transfer-Encoding: binary');
	
	// open the file in binary read-only mode
	// display the error messages if the file canīt be opened
	$file = @ fopen($path, 'rb');
	
	if ($file) {
	
	// stream the file and exit the script when complete
	fpassthru($file);
	exit;
	
	} else {
	
	echo $err;
	
	}
	
	} else {
	
	echo $err;
	
	}
}
?>