Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ICS file Download fails on iPhone Chrome with "Unknown File Type"

I've got a php script that's auto-generating an ics file for a mobile web app.

Using Chrome on my Win7 desktop, the ics file downloads fine, and Outlook likes it.

Using Safari on my iPhone, the ics file opens the calendar app as expected, and allows me to add to calendar.

Using Chrome on my iPhone, I get "Download Failed. Chrome cannot download this file. Error 102 (): Unkown File Type."

I'm sending these headers:

header("Content-Type: text/Calendar; charset=utf-8");
header("Content-Disposition: inline; filename={$slug}.ics");
header("HTTP/1.0 200 OK", true, 200);

and my ics file output is:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//example.com//NONSGML blah blah//EN
METHOD:PUBLISH
BEGIN:VEVENT
UID:[email protected]
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

Any ideas about what iPhone Chrome isn't liking?

like image 697
SteveJ Avatar asked Apr 12 '13 13:04

SteveJ


2 Answers

It looks like a bug in Chrome for iOS. See https://bugs.chromium.org/p/chromium/issues/detail?id=666211

like image 123
Adam Avatar answered Nov 17 '22 23:11

Adam


most examples I see are in lowercase http://www.w3.org/Protocols/rfc1341/4_Content-Type.html

try making that

Content-Type: text/calendar

not

Content-Type: text/Calendar

like image 39
anmari Avatar answered Nov 17 '22 23:11

anmari