使用"未知文件类型"的iPhone Chrome上的ICS文件下载失败

Ste*_*veJ 5 iphone icalendar google-chrome mobile-safari mobile-chrome

我有一个PHP脚本,可以自动为移动Web应用程序生成一个ics文件.

在我的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);
Run Code Online (Sandbox Code Playgroud)

我的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
Run Code Online (Sandbox Code Playgroud)

有关iPhone Chrome不喜欢的任何想法?

anm*_*ari 1

我看到的大多数例子都是小写的 http://www.w3.org/Protocols/rfc1341/4_Content-Type.html

尝试做那个

内容类型:文本/日历

不是

内容类型:文本/日历