我有一个为移动网络应用程序自动生成 ics 文件的 php 脚本。
在我的 Win7 桌面上使用 Chrome,ics 文件下载正常,并且 Outlook 喜欢它。
在我的 iPhone 上使用 Safari,ics 文件按预期打开日历应用程序,并允许我添加到日历。
在我的 iPhone 上使用 Chrome,我得到“下载失败。Chrome 无法下载此文件。错误 102 ():未知文件类型。”
我正在发送这些标头:
header("Content-Type: text/Calendar; charset=utf-8");
header("Content-Disposition: inline; filename={$slug}.ics");
header("HTTP/1.0 200 OK", true, 200);
我的 ics 文件输出是:
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//example.com//NONSGML blah blah//EN
METHOD:PUBLISH
BEGIN:VEVENT
UID:20130412T062148-527420343@example.com
DTSTAMP:20130412T062148
DTSTART:20130524T134500Z
DTEND:20130524T153000Z
LOCATION:
SUMMARY:This is the summary
DESCRIPTION:This is the description
STATUS:CONFIRMED
TRANS:OPAQUE
END:VEVENT
END:VCALENDAR
关于 iPhone Chrome 不喜欢什么的任何想法?