We are using a data URI (RFC 2397) to enable a visitor to download a calendar entry (ICS 2.0 formatted). It works perfectly in Firefox, Chrome (desktop and Android), and Safari, bit it fails in Internet explorer 9 thru 11 and in Edge. This is an example of the URI:
data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:http://example.com/meeting-confirmation/%0ADTSTART:20151130T210000Z%0ADTEND:20151130T220000Z%0ASUMMARY:Meeting%20With%20Company%0ADESCRIPTION:Meeting%20with%20Company%20to%20receive%20an%20overview%20of%20our%20technologies%20and%20discuss%20your%20service%20needs.%20Please%20contact%20Company%20Rep%20promptly%20via%20phone%20at%20123-456-7890%20to%20confirm%20or%20change%20this%20meeting.%0ALOCATION:123%20Fake%20Street,%20Springfield,%20MO%2012345%0AEND:VEVENT%0AEND:VCALENDAR
If it helps, this is generated by feeding the appointment data to carlsednaoui/add-to-calendar-buttons . The script assembles the appointment data into the necessary formats then outputs the URLs for Google and Yahoo calendars and data uri for Outlook and iCal into links in a dropdown button. The Outlook link points to the URI above. When a user clicks the link, it opens a download box so the user can add it into their Outlook calendar (except in IE).
<script>
var myCalendar = createCalendar({
options: {
class: 'my-class',
id: 'my-id'
},
data: {
title: 'Meeting With Company',
start: new Date('11/30/2015 4:00-PM'),
duration: 60,
address: '123 Fake Street, Springfield, MO 12345',
description: 'Meeting with Company to receive an overview of our technologies and discuss your service needs. Please contact Company Rep promptly via phone at 123-456-7890 to confirm or change this meeting.'
}
});
document.querySelector('.new-cal').appendChild(myCalendar);
</script>
I have tried encoding various characters as recommended in Data URI scheme and Internet Explorer 9 Errors, but IE still either does nothing or shows a "Page Cannot be displayed" error page.
https://msdn.microsoft.com/en-us/library/cc848897%28v=vs.85%29.aspx appears to indicate that this usage is not allowed, but I'm not sure. If that's true, since other browsers can handle it, I'm hoping someone knows of a workaround for IE browsers.