首页 > 解决方案 > 移动浏览器在下载时将 .html 添加到文件名

问题描述

出于某种原因,使用此代码:

header("Content-Type: text/x-vcard;charset=utf-8;");
header("Content-Disposition: attachment; filename=card.vcf");
header("Pragma: no-cache");
header("Expires: 0");

echo $vcard_serialized;

在 PC 上的 chrome 上,它下载card.vcf,但从移动设备上下载card.vcf.html......为什么?

标签: phpfilemobilefile-extensionvcf-vcard

解决方案


推荐阅读