-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICS download link does not work on Microsoft browser (including edge) #71
Comments
@dogawaf |
I would not ask you to fix IE limitations :) But at least the limitation should be documented here. More insights:
There is also this JS library that may help: http://danml.com/download.html |
done: added to the bottom of the Usage section: https://github.com/spatie/calendar-links#usage, thanks a lot @dogawaf ! |
Does it work on the chromium based Edge browsers? |
Use download.js version 1.4.8 to trigger ics file download in the browser - it works in Internet Explorer! PHP: $link = Link::create('My Event', $from, $to);
echo '<a href="' . $link->ics() . '" class="ics-link">Download My Event</a>'; jQuery: $('.ics-link').click(function (event) {
var href = $(this).attr('href');
download(href, 'download.ics');
event.preventDefault();
}); |
Hey @wxactly Let me improve (a bit) your solution and rely on $link = Link::create('My Event', $from, $to);
echo '<a href="' . $link->ics() . '" class="ics-link" download="event.ics">Download My Event</a>'; $('a[download]').click(function (event) {
var href = $(this).attr('href');
var storeAsFilename = $(this).attr('download') || 'event.ics';
download(href, storeAsFilename);
event.preventDefault();
}); UPD: or with less jQuery: $('a[download]').click(function (event) {
/** @type {HTMLAnchorElement} */
var anchor = event.target;
var storeAsFilename = anchor.download || 'event.ics';
download(anchor.href, storeAsFilename);
event.preventDefault();
}); |
The ICS download link proposed by this library does not work on Microsoft browsers because they do not support navigating to data uri:
The text was updated successfully, but these errors were encountered: