此代码段应通过网络将文件tiff或modi从 Web 服务器传输到用户
header('Content-Description: File Transfer');
header('Content-Type: ' . $file_mime_type);
header('Content-Disposition: attachment; filename="' . $file_name . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . $file_size);
# till this moment all is fine
echo file_get_contents("path/to/file.tif");
# script fails on line above, and doesnt reach this place
当文件格式不是 tiff 或 modi 时,一切正常,客户端浏览器开始下载文件(docx/xlsx/pdf/等)当用户尝试下载 tiff 或 modi 时,脚本失败且没有任何错误。试过print(file_get_contents("path/to/file.tif")); 和readfile("path/to/file.tif"); 而不是回声,结果是一样的