<?php
$inputputfile = $_GET['filename'];
$command = $_GET['type'];
if($command=='get')
{
	if (file_exists($inputputfile)) 
	{
		header('Content-Description: File Transfer');
		header('Content-Type: application/octet-stream');
		header('Content-Disposition: attachment; filename="'.basename($inputputfile).'"');
		header('Expires: 0');
		header('Cache-Control: must-revalidate');
		header('Pragma: public');
		header('Content-Length: ' . filesize($inputputfile));
		readfile($inputputfile);
	}
	else
		echo "FAILED\r\n";
}
else if($command=='delete')
{
	echo $inputputfile." RESULT: ".unlink($inputputfile)."\r\n";
}
 ?>
