Reputation: 1
I've written a php script which produces an ics file output:
BEGIN:VCALENDAR
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20120801T000000Z
DTSTART:20120801T000000Z
DTEND:20120801T000000Z
SUMMARY:test
ORGANIZER:Me
UID:Me
END:VEVENT
END:VCALENDAR
The file is shown to be valid when using the online validator:
http://severinghaus.org/projects/icv/
Now here's the strange thing.... If I opt to open the file as it is generated by the php I get the MS Outlook error message is not a valid internet calendar file. But, if I open it from the folder it's created in, it gets imported without trouble.
Does anyone have any ideas?
Upvotes: 0
Views: 2322
Reputation: 4143
As josh has noted, it is probably incorrect headers:
eg: ics file generated from wordpress plugin has:
header('Content-Type: text/calendar; charset=' . get_option('blog_charset').';');
header('Content-Disposition: attachment; filename="ical.ics"');
Upvotes: 0