I\'m generating a .ics calendar entry from JS, next I open it using a data-URI:
window.open(\"data:text/calendar;charset=utf8,\" + escape(icsMSG));
>
Simplified solution could be just use the download attribute inside a link to set a filename
iCal Calendar