【发布时间】:2011-05-26 14:34:05
【问题描述】:
我想知道,如何实现 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 作为下载提供给用户?
【问题讨论】:
-
你确定路径
$path.$file定义的文件存在吗?打开error_reporting(E_ALL); ini_set('display_errors', 'on');并重复 ;-)