php 强制下载文件实现代码
2013-10-28 00:00
841 查看
<?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实现文件下载的一段代码
- php实现文件下载代码一例
- 使用PHP自带zlib函数 几行代码实现PHP文件打包下载zip
- php简单实现文件或图片强制下载的方法
- IE php关于强制下载文件的代码
- PHP用代码实现文件下载
- php简单实现文件或图片强制下载的方法
- PHP 强制下载文件代码
- php强制下载文件代码
- PHP 实现文件强制下载
- PHP用代码实现文件下载
- php下连接ftp实现文件的上传、下载、删除文件实例代码
- PHP代码实现远程下载文件到本地的函数
- PHP强制下载PDF文件实现代码
- PHP 强制下载文件代码
- 使用PHP下载CSS文件中的所有图片【几行代码即可实现】
- PHP用代码实现文件下载
- php做下载文件的实现代码及文件名中乱码解决方法