if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: " /> 黑人与中国女一级毛片不卡 ,亚州激情,亚洲不卡视频在线观看

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

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下載文件的代碼示例,轉載需保留來源!

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

主站蜘蛛池模板: 国产成人精品免费视频大 | 亚洲一区二区三区深夜天堂 | 欧美一区二区三区性 | 四虎最新永久免费视频 | 精品国产制服丝袜高跟 | 久久网伊人 | 美女扒开屁股给男人看无遮挡 | 亚洲一区高清 | 色中文网| 韩国毛片免费 | 国产伦精一区二区三区 | 色综合天天色综合 | 国产精品视频在 | 色网在线| 精品福利一区 | 欧美一级免费 | 黄在线视频 | 亚洲成a人片在线网站 | 免费视频一区二区 | 狠狠夜色午夜久久综合热91 | 色偷偷影院 | 亚洲一区亚洲二区亚洲三区 | 中文字幕在线观看日韩 | 亚洲无吗在线视频 | 久久久久久岛国免费网站 | 高清视频一区二区 | 国产日韩欧美综合一区二区三区 | 日本欧美一区二区三区视频麻豆 | 欧美视频a | 91视频中文| 色综合久久精品中文字幕 | 国产精品自在线拍 | 97成人在线 | 免费在线看黄网站 | 色婷婷色综合激情国产日韩 | 国产精品欧美在线 | 男女牲交一级毛片 | 精品福利视频第一 | 国产精品一区二区免费 | 99久久精品国内 | 亚洲成人福利在线观看 |