在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<?php $file = '文件路径和名字'; 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'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit; } ?> 如果文件较 $handle = fopen($file, 'rb'); {
输出类似于 html代码 <a href="api/image.php?action=down&id=1111" class="btnDownload" target="_blank">下载</a>
|
2022-08-18
2022-08-17
2022-07-18
2022-08-18
2022-07-29
请发表评论