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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

generating ics (calendar) download


Go to End


2 Posts   2059 Views

Avatar
StarForce

Community Member, 11 Posts

18 October 2010 at 4:09am

Hi

i´m trying to create a method which generates an ics file and sends it to the browser as a download. This is a first test i made:

function calendar(){

$test = 'BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR';

return SS_HTTPRequest::send_file($test, "calendar.ics","text/calendar");
}

but for some reasons it doesn´t work. when calling this method, the browser only displays the text, no download :/

any idea?

Thank you :)

StarForce

Avatar
StarForce

Community Member, 11 Posts

30 October 2010 at 7:01am

hmm no idea?

should be possible to create a simple download :/