Ai
1 Star 3 Fork 0

FreeWind/简易的PHP图书后台管理系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
download.php 771 Bytes
一键复制 编辑 原始数据 按行查看 历史
FreeWind 提交于 2025-05-29 17:20 +08:00 . 简易的PHP图书后台管理系统
<?php
$filename = isset($_GET['filename']) ? $_GET['filename'] : '';
$uploadDir = './upload/';
$filePath = $uploadDir . basename($filename);
if (file_exists($filePath) && is_file($filePath)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . urlencode($filename));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($filePath));
ob_clean();
flush();
readfile($filePath);
exit;
} else {
echo "<script>alert('文件不存在!');window.history.back();</script>";
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/FreeWind2333/Simple-PHP-Library-Management-System.git
git@gitee.com:FreeWind2333/Simple-PHP-Library-Management-System.git
FreeWind2333
Simple-PHP-Library-Management-System
简易的PHP图书后台管理系统
master

搜索帮助