1. 首页
  2. 数据库
  3. 其它
  4. PHP 强制性文件下载功能的函数代码(任意文件格式)

PHP 强制性文件下载功能的函数代码(任意文件格式)

上传者: 2020-12-23 05:55:16上传 PDF文件 27.45KB 热度 5次
复制代码 代码如下: /******************** *@file – path to file */ function force_download($file) { if ((isset($file))&&(file_exists($file))) { header(“Content-length: “.filesize($file)); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=”‘ . $file . ‘”‘); re
下载地址
用户评论