Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

[SOLVED] Event Calendar ics trouble in SS 2.4


5 Posts   1011 Views


29 August 2011 at 4:59pm Community Member, 133 Posts


I've noticed .ics files do not work properly on Silverstripe 2.4.x for me. The ics files download, but the browser seems to treat them as html files. And when a calendar program tries to open the file it does not import the calendar event at all.

This is even happening on the event calendar demo for me:

My sites with Silverstripe 2.3.x do not have this issue.
Is anyone else having this issue?



31 August 2011 at 5:50am 4085 Posts

I think it depends on your browser. For me, those ICS files download to iCal in Safari, but an older browser like IE may not know what to do with that content type.

SilverStripe tips, tutorials, screencasts and more:


31 August 2011 at 11:14am Community Member, 133 Posts

I'm testing in Firefox 6, Chrome 13, IE9. I don't know which browser my client is using, but they are having the same issue.

The weird thing is on 2.3 installs the ics files work fine, but on 2.4 installs the ics files aren't recognised as ical data. The contents of the files are the same in each.


19 September 2011 at 6:51pm Community Member, 1 Post

SilverStripe seems to override the content-type of headers that are not set by SilverStripe's own header functions. Adding the following line to the top of your ics action in the Calendar_Controller class of Calendar.php should give you the correct header:

$this->getResponse()->addHeader('Content-Type', 'text/calendar');

The same goes for the new ical action and the rss action, but with "text/xml" or "application/rss+xml" as the content type for rss.


20 September 2011 at 3:19pm Community Member, 133 Posts

Wow. Thank you very much. That worked perfectly.