views:

595

answers:

2

Hello,

I'm setting up a feature for "exporting as ics file" (iCal) our weekly school agenda. The download prompt works but when opening it in iCal (Mac OS X), iCal tells me the calendar is invalid. I opened the file in a text editor and it looks ok to me.

I suspect my download.php script is wrong or setting the wrong mimetype.

I tried text and text/calendar. No luck.

So my question is this: what's the correct mimetype for ics files?

+2  A: 

iCalendar data has the MIME content type text/calendar.

Wikipedia

If you're saving it then loading it, I doubt that's the problem though - check your data, charset, line endings...

Greg
ok thanks. I'll create a new question more related to the code if i can't manage it.
pixeline
+1  A: 
text/calendar

From the RFC 2447 iCalendar Message-Based Interoperability Protocol:

2.1 MIME Media Type

A MIME entity containing content information formatted according to
this document will be referenced as a "text/calendar" content type. It is assumed that this content type will be transported through a MIME electronic mail transport.

splattne