[英]How to open file:///sharedDrive url in same window in browser using java
I tried to open file:///sharedDrive url in new window of broswer using我尝试在浏览器的新窗口中打开 file:///sharedDrive url 使用
<button onclick="myFunction()">Folder</button>
<script>
function myFunction()
{
window.open("file://///sharedDrive/folder/");
}
</script>
Its opening url in IE, but not in Firefox/Chrome.它在 IE 中的打开 url,但不是在 Firefox/Chrome 中。
Even i tried to open this url using即使我试图打开这个网址使用
reponse.sendRedirect("file://///sharedDrive/folder/");
But its appending localhost:port\\ before opening this url.但是它在打开这个 url 之前附加了 localhost:port\\。
imho there is no way to open a file in chrome anyways, but it will be downloaded.恕我直言,无论如何都无法在chrome中打开文件,但它会被下载。 Even if you type the file:// url directly in the address bar, the same happens, regardless of shared or local file.即使您直接在地址栏中输入 file:// url,无论是共享文件还是本地文件,都会发生同样的情况。 The only exceptions are pdfs and images.唯一的例外是 pdf 和图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.