【发布时间】:2013-04-14 20:55:23
【问题描述】:
我正在使用下面的代码下载一个文件,它运行良好,但问题是文件扩展名丢失,即使在压力下载之后也是如此。我已尝试将其更改为其他 MIME 类型,可能是什么问题以及如何解决?
header('Content-Type: audio/mp3');
header("Content-Disposition: attachment; filename=$row[3]");
header("Content-Length: ".filesize("$row[1]$row[2]"));
$fp = fopen("$row[1]$row[2]", "r");
fpassthru($fp);
fclose($fp);
注意:$row 数组中的值没问题。
【问题讨论】:
标签: php apache .htaccess http-headers