在iPhone上使用Google Chrome下载ICS文件 [英] Download ICS file with Google Chrome on iPhone

查看:127
本文介绍了在iPhone上使用Google Chrome下载ICS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上存储了一个ICS文件(文本/日历" MIME类型).

I have an ICS file ('text/calendar' MIME type) stored on my server.

在JavaScript中,我称之为:

In JavaScript I call:

window.open("/path/to/file.ics");

它可以在所有浏览器上使用,甚至可以在iPhone上的Safari上使用.但是,当我尝试使用Chrome(iPhone版本)时,没有任何反应.没有下载.屏幕上没有错误-没有.

It works on all browsers, even on Safari on my iPhone. But when I try on Chrome (the iPhone version) nothing happens. Nothing downloads. There are no errors on the screen―nothing.

也许有人去过那里并且有一些建议.

Maybe someone has been there before and has some suggestions.

提前谢谢!

推荐答案

还应该可以使用旧版本创建下载链接,将其附加到文档中,单击它,然后将其删除.

It should also be possible to use the good old create a download link, append it to the document, click it, and then remove it trick.

let icsLink = document.createElement("a");
icsLink.style.display = "none";
icsLink.href = "/path/to/file.ics";
icsLink.setAttribute("download","download");
document.body.appendChild(icsLink);
icsLink.click();
document.body.removeChild(icsLink);

这篇关于在iPhone上使用Google Chrome下载ICS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆