jquery - Internet Explorer 8 and vCalendar/ICS files -


i'm trying dynamically generate vcal file using javascript , working fine until try in ie8. in ie8 browser tries open calendar file in request bar instead of downloading. sample of code use

var ical =      "begin:vcalendar\n" +     "prodid:-//microsoft corporation//outlook 14.0 mimedir//en\n" +     "method:publish\n" +     "begin:vevent\n" +     "attendee;cn=\""+locationalias+"\";cutype=resource;role=non-participant;rsvp=true:mailto:"+locationemail+"\n" +     "dtend;tzid=\"gmt standard time\":"+dend+"\n" +     "dtstart;tzid=\"gmt standard time\":"+dstart+"\n" +     "location:"+locationname+"\n" +     "organizer;cn=\"<someuser>\":mailto:<somemailto>\n" +     "end:vevent\n" +     "end:vcalendar"; 

return ical;

i try open calendar file using following;

window.open( "data:text/calendar;charset=utf8," + escape( ical) ); 

any suggestions why ie8 cannot recognize file?

to around problem generated ical file 1 server side , exposed client via restful webservice.

in order identify response of type calendar set following

responsebuilder builder = response.ok();     builder.header("content-disposition",             "attachment;filename=calendar.ics"); 

when ie8 receives response automatically attempts download/open file using default outlook instance.

this works across browsers. have overhead of requiring request server lets me apply processing on request validating conference room valid etc.


Comments