1 Star 3 Fork 4

Yidian/PHP read PDF

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
read_pdf.php 467 Bytes
一键复制 编辑 原始数据 按行查看 历史
不二活 提交于 2018-03-12 13:25 +08:00 . pdf读取V1.0
<?php
/**
* @Author: chr
* @Date: 2018-03-09 12:49:02
* @Last Modified by: chr
* @Last Modified time: 2018-03-09 12:58:58
*/
$file = $_GET['filename'];
//检测文件格式,检测文件是否存在
if(strtolower(substr(strrchr($file,'.'),1)) != 'pdf'){
echo "文件格式不正确";
exit();
}
if(!file_exists($file)){
echo "文件不存在";
exit();
}
header('Content-type: application/pdf');
header('filename='.$file);
readfile($file);
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/chenhr_230/PHP-read-PDF.git
git@gitee.com:chenhr_230/PHP-read-PDF.git
chenhr_230
PHP-read-PDF
PHP read PDF
master

搜索帮助