2
votes

I have below mentioned line in html
< a href="data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:https://www.example.com%0ADTSTART:20130615T133000Z%0ADTEND:20130615T173000Z%0ASUMMARY:Sum%0ADESCRIPTION:Desc%0ALOCATION:Loc%0AEND:VEVENT%0AEND:VCALENDAR">AddToCalendar < /a>

On clicking this line generates .ics file in Chrome and Firefox browser, but it fails in Safari and IE.

In safari it downloads a file called "unknown" In IE it opens a new tab saying "The webpage cannot be displayed"

Please help me fixing this.

Content of generated ics file is below

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
URL:https://www.example.com
DTSTART:20130615T133000Z
DTEND:20130615T173000Z
SUMMARY:Sum
DESCRIPTION:Desc
LOCATION:Loc
END:VEVENT
END:VCALENDAR

But the expected result is .ics file

Does anyone knowthe reason?

1

1 Answers

0
votes

iCalendar uses CRLF as line separator so you should use %0D%0A instead of just %0A Then, you are missing the DTSTAMP and UID property which are mandatory for a VEVENT.

Now, does that have anything to do with your browser issue, I'm not sure...