<?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 (FILE_MANAGER_ID_PASSWORD_USE == 'YES') {
		if ($_SESSION['_id_mgr_logincheck'] <> "OK") {
			exit;
		}
	}
	if ($_GET['path'].'' == '') {
		error_simple_html('エラー', 'パス指定がありません。');
	}
	$path = my_GET('path');
	if ($fp = @myfile_fopen($path, "rb")) {
		$filename = substr($path, strrpos($path, '/')+1);
		if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
			$filename = myfile_ENCODE($filename);
		} else {
			$filename = urlencode($filename);
		}
		header("Content-type: application/x-download\n");
		header("Content-disposition: filename=".$filename."\n");
		fpassthru($fp);
	}
?>
