在用户单击时打开与应用程序的文件链接 [英] Open file link with application on user click
问题描述
在我的网站中,我有一个 kml 文件的链接.
In my website i have a link to kml file .
当用户单击此链接时,我想使用Google Earth应用程序打开此kml文件.
When a user clicks on this link ,I want to open this kml file with google earth application.
在android中,我们可以通过使用intent并提供内容类型来做到这一点.
In android we can do it by using intent and providing content type.
与台式机一样怎么做? 否 但这不能解决问题.
How to do the same is desktop ? NO But it will not solve the problem.
是否可以使用脚本打开用户要求的同意书? 我可以运行任何客户端脚本来执行此操作吗.
Is there way to ask for user consent if yes open using script? Can i run any client side script to do this.
推荐答案
如您链接到的答案所述:
通常,您无法从网页在客户端计算机上运行任意程序.无论是否同意.您只能通过在用户同意后安装浏览器插件或以其他方式要求用户采取措施来做到这一点.
允许这样做会带来安全隐患.
You generally can't run arbitrary program on the client machine from a web page. With or without consent. You can only do this by installing a browser plug-in after the user consent or otherwise asking the user for actions.
Allowing this will be a security hazard.
您可以使用标准的网页操作.但是,结果可能取决于客户端用户配置.
You can use standard web page actions. But then the result can depend on client side user configuration.
在链接的答案中还提到您可以使用基于Web的Google Earth.当然,如果您仍然愿意,可以使用一些简单的客户端脚本来要求确认.
It is also mention in the linked answer that you can use the web base Google Earth. And of course you can use some simple client side script to ask confirmation for that if you still like to.
这篇关于在用户单击时打开与应用程序的文件链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!