Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.ics files not opening in Chrome Mobile for Apple Devices

I'm getting an Error 102 (): Unknown File Type. when trying to download an .ics file from an ASP.Net application. The file looks like this:

BEGIN:VCALENDAR
PRODID:-//Test
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
UID:uid
CLASS:PUBLIC
DTSTART:20130506T173000
DTEND:20130506T190000
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: What would you do with an extra $2500? 
SUMMARY:Smoking Cessation May
PRIORITY:0
LOCATION:ARMC Theater
END:VEVENT
END:VCALENDAR

My Response code in C# is this:

HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}.ics", "example"));
HttpContext.Current.Response.ContentType = "text/calendar";
HttpContext.Current.Response.Write(calendarData.ToString());
HttpContext.Current.Response.End();

Any suggestions?

like image 941
Chris Avatar asked Oct 27 '25 22:10

Chris


1 Answers

Everything I've read says it's not possible through Chrome Mobile. If you find an answer, I'd be interested as well.

If it's any help, I know it's possible through Safari Mobile. The answer is here:

How do you add a link that will add an event to your iPhone calendar from safari?

With Safari Mobile, the solution is simply to link to the .ics file, but this wasn't even possible with Safari Mobile until iOS 5.

Sorry, and best of luck!

like image 118
Kyle Challis Avatar answered Oct 29 '25 13:10

Kyle Challis