if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: " /> 免费黄色在线观看,日韩精品人成在线播放,欧美成人免费在线视频

中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

php下載文件的代碼示例

復(fù)制代碼 代碼如下:
<?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;
}
?>

以上代碼是下載代碼
接下來(lái)貼一段在線預(yù)覽pdf文件的代碼
復(fù)制代碼 代碼如下:
<?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技術(shù)php下載文件的代碼示例,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 亚洲一级淫片 | 国产欧美精品区一区二区三区 | 成人在线观看免费 | 91福利在线观看视频 | www.嫩草| 91xxx在线观看 | 九九热精品在线视频 | 欧美在线资源 | 一级黄色毛片免费 | 亚洲一区二区久久久 | 亚洲电影免费 | 欧美aaa一级片 | 91免费在线看 | 久久久网 | 欧美久久久久久久 | 日日噜噜夜夜爽爽狠狠 | 免费黄色大片 | 中文字幕第一页在线 | 91九色婷婷| 国产福利91精品一区二区三区 | www.天天干.com | 91视频在线看 | 91精品国产乱码久久久久久久 | www.av在线| 一区二区国产精品 | 国产高清免费 | 有码一区 | 东京久久| 精品国产一区探花在线观看 | 在线观看av不卡 | 亚洲成人在线免费 | 午夜视频在线 | 国产精品日韩欧美一区二区 | a久久| 亚洲高清在线免费观看 | 国产精品色综合 | 午夜私人影院在线观看 | 欧美在线综合 | 亚洲精品第一国产综合野 | 亚洲精品黄 | 日本国产精品视频 |