首页 > 解决方案 > 从 excel 触发的 Chrome 中的下载不起作用

问题描述

大家好,我刚刚发现 chrome 已经贬值了从 iframe 或沙箱触发的下载。因此,我触发的任何下载都无法在 excel 插件中按预期工作(仅在 chrome 中)。我认为 excel 开发团队应该在他们的 iframe 中添加属性“允许下载”,请参考图片以查看扩展 iframe 中添加的属性。请让我知道是否有任何替代品。

在此处输入图像描述

Chrome 折旧参考链接 - https://developers.google.com/web/updates/2020/04/chrome-83-deps-rems

我在excel中使用的代码添加 window.open('*url to your file*', 'Download');

更新 - 我在 office js repo 中提出了一个问题,https://github.com/OfficeDev/office-js/issues/1241

标签: exceloffice-jsoffice-addinsopenoffice-api

解决方案


编写如下批处理命令并将其保存为 filename.bat。然后执行它。它应该下载文件

start "Enter the full path of downloading file"

推荐阅读