[英]How to can i open a network path in file explorer to view files using javascript?
I asked this before, and I am told that this is impossible. 我之前曾问过这个问题,并被告知这是不可能的。 It this true?
这是真的吗?
All I want is to open a network folder when I click a button. 我想要的只是单击按钮时打开一个网络文件夹。 To open 'File Explorer' to that network path on the PC.
在PC上打开“文件资源管理器”到该网络路径。 Or on the browser.
或在浏览器上。 I prefixed
file:///
to the path so that it may open in a browser. 我在该路径前添加了
file:///
前缀,以便可以在浏览器中打开它。
//jQuery for button 1.
$(document).on("click",".Button1",function (){
var log1 = "file:/"+this.value;
// this.value has path like this: ///PCname/Foldername/subfolder
window.location.href = log1
});
Am I asking the impossible? 我是在问不可能吗? I can't copy my files to document root.
我无法将文件复制到文档根目录。 I have 10s of thousands of files.
我有成千上万的文件。 This is why I want to open a folder on my Windows PC to that path.
这就是为什么我要在Windows PC上打开指向该路径的文件夹的原因。 My path to files changes depending on what the user has selected, and my files are 50MB or less.
我的文件路径会根据用户选择的内容而变化,并且我的文件为50MB或更小。
Is there a way I could open a network folder in the browser like this (not local drive, network path), OR a way to open a folder on the PC to that network path when I click a button? 有没有一种方法,我可以在浏览器中打开一个网络文件夹像这样 (没有本地驱动器,网络路径),还是有办法打开PC到网络路径上的文件夹,当我点击一个按钮?
My backend is Django+Python. 我的后端是Django + Python。
JavaScript in the context you mention, can't do that. 您提到的上下文中的JavaScript无法做到这一点。 In this context JS is a client side programming language that runs in the browser.
在这种情况下,JS是在浏览器中运行的客户端编程语言。
What you have in mind needs to run on the server-side and then transmitted to the browser. 您要记住的内容需要在服务器端运行,然后传输到浏览器。
Here are the general steps you should take: 以下是您应该采取的一般步骤:
This is the most basic setup. 这是最基本的设置。 You can improve that with server-side technologies like Python or NodeJS.
您可以使用Python或NodeJS之类的服务器端技术进行改进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.