if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Di " /> 亚洲精品久久久,国产韩日精品,免费看久久久

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

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;
}
?>
?
<?php
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=ins.jpg"); 
readfile("imgs/test_Zoom.jpg");
?>

php技術php 強制下載文件實現代碼,轉載需保留來源!

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

主站蜘蛛池模板: 始兴县| 望城县| 郴州市| 丘北县| 沛县| 尚志市| 广南县| 亚东县| 垫江县| 盐源县| 威海市| 灵寿县| 修文县| 哈密市| 当阳市| 嘉峪关市| 临澧县| 丹寨县| 宜兰市| 东辽县| 翁源县| 温州市| 五华县| 林州市| 宜城市| 汽车| 苍梧县| 崇礼县| 成都市| 朝阳县| 宣汉县| 利津县| 买车| 明光市| 泰州市| 凯里市| 亚东县| 象州县| 砚山县| 乳山市| 太和县|