<?php
	require("../__common__/__define_common.php");
	require("../__common__/include-common-all.php");
	require("__include-common-code-file.php");
	my_session_start();
	require("../account/__logincheck.php");
	if ($_SESSION['システム管理者'] <> "YES") {
		exit;
	}
	if ($_GET['path'].'' == '') {
		error_simple_html('エラー', 'パス指定がありません。');
	}
	$path = $_GET['path'];
	if ($fp = @myfile_fopen($path, "rb")) {
		$filename = substr($path, strrpos($path, '/')+1);
		if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
			$filename = mb_convert_encoding($filename, 'SJIS-win', 'UTF-8');
		} else {
			$filename = urlencode($filename);
		}
		header("Content-type: application/x-download\n");
		header("Content-disposition: filename=".$filename."\n");
		fpassthru($fp);
	}
?>
