pixeline
pixeline

Reputation: 17974

PHP script: download ics file

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?

Upvotes: 2

Views: 2902

Answers (3)

megaSteve4
megaSteve4

Reputation: 1760

This might be handy for others its an iCal validator - http://severinghaus.org/projects/icv/

Upvotes: 0

splattne
splattne

Reputation: 104030

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.

Upvotes: 1

Greg
Greg

Reputation: 321578

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...

Upvotes: 3

Related Questions