I-phone不支持使用标题下载文件

时间:2019-04-18 10:11:40

标签: php

当我从android代码下载文件时,对我来说有效,但如果使用iPhone浏览器则不下载文件。

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$fileName.'".mp4');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
// header("Content-Type: video/mp4")
header('Content-Length: ' . filesize($filePath)); //Absolute URL
ob_clean();
flush();
readfile($filePath);

0 个答案:

没有答案