if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: " /> 成年人黄色大片,夜夜天堂,av在线看片

四虎精品视频-四虎精品成人免费网站-四虎黄色网-四虎国产视频-国产免费91-国产蜜臀97一区二区三区

php下載文件的代碼示例

復制代碼 代碼如下:
<?php
$file = 'monkey.gif';

if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>

以上代碼是下載代碼
接下來貼一段在線預覽pdf文件的代碼
復制代碼 代碼如下:
<?php
public function fddAction()
{
// get attachment location
$attachment_location = $_SERVER["DOCUMENT_ROOT"] . "/pdf/fdd/sample.pdf";

if (file_exists($attachment_location)) {
// attachment exists

// send open pdf dialog to user
header('Cache-Control: public'); // needed for i.e.
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="sample.pdf"');
readfile($attachment_location);
die(); // stop execution of further script because we are only outputting the pdf

} else {
die('Error: File not found.');
}
}
?>

php技術php下載文件的代碼示例,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 五年级字谜| 昆虫记读书笔记摘抄| 杀破狼3国语在线观看| 五的词语| 迪卡娅电影| 詹瑞文| 狗年电影| 想要女朋友菲律宾| 电影在线观看网址| ryan reynolds| 盗梦空间结局官方解释| 是王者啊第二季免费观看完整版| 二年级最佳家长评语| 风间由美的作品| 五年级下册语文第七单元口语交际| 富二代| 男操女视频免费| 古建凉亭生产厂家| 意大利火环1990| 教学质量分析 | 饥渴的少妇电影完整版 | 日本大片网站| 电影《神童》| 血色誓言演员表| department什么意思| 叶子楣地下裁决| 寄宿生韩国电影| 梦想建筑师泰国百合剧| 混凝土结构设计规范gb50010-2020 | 誓不忘情 电影| 爸爸别走歌曲原唱| 翁姆| 博人传青年篇动漫在线观看免费| 等着我 综艺| 贵州三日游| 刘浩存个人资料及简介| 真的爱你最标准谐音歌词| 最美情侣高清免费观看视频大全| 康瑞德家的男孩| lanarhoades最经典电影| 黄视频在线播放|