如何使用java在浏览器中的同一窗口中打开file:/// sharedDrive url

时间:2014-04-15 06:33:14

标签: java javascript url httpresponse

我尝试使用

在broswer的新窗口中打开file:/// sharedDrive url
<button onclick="myFunction()">Folder</button>
<script>
function myFunction()
{
window.open("file://///sharedDrive/folder/");
}
</script>

它在IE中的开放网址,但不在Firefox / Chrome中。

即使我尝试使用

打开此网址
reponse.sendRedirect("file://///sharedDrive/folder/");

但是在打开此URL之前,它附加了localhost:port \。

1 个答案:

答案 0 :(得分:0)

imho无论如何都无法在chrome中打开文件,但会将其下载。即使您直接在地址栏中键入file:// url,也会发生同样的情况,无论共享文件还是本地文件。唯一的例外是pdfs和图像。