文件下载权限管理

master
fengyuexingzi 8 years ago
parent 84febebf88
commit 1bc7142991

@ -10,7 +10,7 @@
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
phpinfo();die;
// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');

@ -0,0 +1,17 @@
<?php
/**
* Created by PhpStorm.
* User: Wind
* Date: 2017/11/24
* Time: 9:18
*/
if (isset($_REQUEST['id']) && $_REQUEST['id'] == 3)
{
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=abc.txt");
header("X-Sendfile: d:/file/file1.txt");
exit;
}
?>
<h1>Permission denied</h1>
<p>Login first!</p>
Loading…
Cancel
Save