使用JavaScript,客户端打开文件 [英] Open a file using javascript, client-side

查看:129
本文介绍了使用JavaScript,客户端打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我想开一个客户端机器上的文件。我创建了两个应用程序:桌面和Web应用程序。当用户安装桌面应用程序有它复制到其安装路径的一些文件,我想从通过javascript我的web应用程序中打开这些文件。

In my application I want to open a file that exists on a client machine. I created two applications: desktop and web application. When the user installs the desktop application there are some files which is copied to its installation path, and I want to open those files from my web application via javascript.

推荐答案

浏览器从主机(沙盒)出于安全考虑绝缘。

The browser is insulated from the host machine (sandboxed) for security reasons.

有关浏览器(那些除了沙箱内,即cookies和缓存)访问本地文件的唯一方法是通过显式用户使用的HTML文件的控制。

The only way for the browser to access local files (apart from those inside the sandbox, ie. cookies and cache) is the HTML file control used by the user explicitly.

这篇关于使用JavaScript,客户端打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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