📜  文件查看器 codeigniter - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:52.258000             🧑  作者: Mango

代码示例1
function view_file() {
        $id = $this->uri->segment(3);
        $file = realpath('./uploads/'.$id);
        header("Content-disposition: inline;filename=".$id);
        header('Content-Type: application/pdf');
        @readfile($file);
    }