<?php
/*<outscirt><version>20181010</version></outscirt>*/

function O__download($O__path){
	set_time_limit(0);
	$O__fileSize = filesize($O__path);
	$O__pathArray = pathinfo($O__path);
	$O__filename  = $O__pathArray["basename"];

	if (file_exists($O__path)){
		header("Content-Type: application/octet-stream");
		header("Content-Disposition: attachment; filename=\"" . $O__filename . "\"");
		header("Cache-Control: private");
		header("Content-Length: " . $O__fileSize);
		//readfile($O__fileDownload);
		$O__fileDownloading = fopen($O__path,"rb");
			while(!feof($O__fileDownloading)) {
				print(fread($O__fileDownloading, 1024*8));
				ob_flush();
				flush();
			}
	}	
}
?>
