我想知道,我怎样才能实现Vcard下载。这是我当前的代码:
$path = "../../media/resources/";
$file = "someName.vcf";
header('Content-Type: text/x-vCard');
header('Content-Disposition: attachment; filename= "'.$file.'"');
header('Content-Length: '.filesize($path.$file));
header('Connection: close');
readfile($path.$file);
不幸的是,它只给出 .vcf 文件中的内容。如何将此 vcard 作为下载提供给用户?