<?php
error_reporting(0);
$fileName='export/'.$_GET['f'];
if(substr($fileName,-3)=='xls'){
	header('Connection: Keep-alive');
	header('Access-control-allow-origin: *');
	header('Content-Description: File Transfer');
	header('Content-Disposition: attachment; filename="'.basename($fileName).'"');
	header('Content-type: application/vnd.ms-excel');
	header('Expires: 0');
	header('Pragma: public');
	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
	set_time_limit(0);
	$file = @fopen($fileName,"rb");
	while(!feof($file)){
		print(@fread($file, 1024*8));
		ob_flush();
		flush();
	}
	exit();
}