mirror of
https://github.com/xiaoqidun/phpcp.git
synced 2025-04-05 19:52:50 +08:00
feat(首次发布): 添加项目文件
This commit is contained in:
404.phpREADME.mdauto.phpautocp.phpautopk.phpchmod.phpconfig.phpcopy.phpcreate.phpdelete.phpdget.phpeditor.phpemail.phpfile.phpflist.phpindex.phpkernel.phpmail.phpmbconv.phpmove.phpmultiple.phppclzip.phpperms.phppkzip.phpreadme.txtrename.phpshell.phpstyle.csssystem.phptarcls.phpunpack.phpunzip.phpupload.phpview.phpxhtml.php
29
dget.php
Normal file
29
dget.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_GET['path'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (($path = trim($_GET['path'])) == "") {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_file($path) || !is_readable($path)) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} else {
|
||||
$myfs = new filesystem($path);
|
||||
$info = $myfs->getpath();
|
||||
if (isset($_GET['mime']) && strlen($mime = trim($_GET['mime'])) >= 3) {
|
||||
header("Content-Type: $mime");
|
||||
} else {
|
||||
___download($path);
|
||||
exit;
|
||||
}
|
||||
header("Accept-Ranges: bytes");
|
||||
header("Content-Length: " . $info['size']);
|
||||
$fp = fopen($path, "rb");
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 4096);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user