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.

General Questions /

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

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

generating ics (calendar) download


Reply


2 Posts   1162 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 :/