我有一个 PHP 脚本,可以为移动 Web 应用程序自动生成 ics 文件。
在我的 Win7 桌面上使用 Chrome,ics 文件下载效果很好,Outlook 也喜欢它。
在我的 iPhone 上使用 Safari,ics 文件按预期打开日历应用程序,并允许我添加到日历。
在 iPhone 上使用 Chrome 时,我收到“下载失败。Chrome 无法下载此文件。错误 102 ():未知的文件类型。”
我正在发送这些 header :
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 不喜欢什么有什么想法吗?
最佳答案
这看起来像是 iOS 版 Chrome 中的一个错误。请参阅https://bugs.chromium.org/p/chromium/issues/detail?id=666211
关于iphone - iPhone Chrome 上的 ICS 文件下载失败,错误代码为 "Unknown File Type",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15972628/