i’m having trouble browsing to a network location from Dash dcc.button.
i have used most common methods for that, including subprocess, open, os.system etc…
I had some success when Dash app running locally (windows machine) and browse over to localhost (127.0.0.1)
But it never worked on Linux server, when dash app is on Linux and clients are windows. (so the callback is working.)
I’m aware of the usage of 2 slash \ “\” to get 1 slash \ “\”, and also tried // / considering dash is running on Linux, didn’t found any mathcing set to work. the UNC path for the smb share i’m trying is : \192.168.6.10\Open or using DNS server locally: \fileserver\Open. Those options are working with subprocess.Popen and os.system(r’explorer “\192.168.6.10\Open”') when running locally, but not on Linux.
So this is the dcc.button, dash app is hosted on Linux machine on local network, clients are windows.
the clients have that mounted. I just need the button to execute a local operation for browsing (clients are windows).
Does this still needs the Linux server , serving the dash app to have that mounted ?
Hello @jinnyzor , for local files (per your example) there is no problem. os.system is working fine.
The issue is for a network location that is SMB share, is working both with IP and also name , because of the local DNS server. So let’s focus on the problem !
Dash App, if running locally (my windows pc) and visit on 127.0.0.1 (localhost) , is working with os.system or subsystem open just fine !
IF now Dash app is running on a local Linux Server, which is accessible by the users with it’s IP or Hostname via a internet browser (ALL in Local LAN), the dcc.button is not working !
So i’m posting here so i can get more expertise suggestion from this forum. Thank you !
Hello Jinny, is suppose to open a network path SMB share \192.168.6.10\abc\abc
not a file. The location is accessible from both , windows and linux servers, serving the dash app.
Clients are all on windows. I’m using os.system() command in the function of callback.
@jinnyzor hello !! i did some test on windows server , debian server with mounted and unmounted SMB shares so i can identify what is the problem.
the problem is that the command in dcc.button, for example
[subprocess.Popen(r’explorer /open,“\192.168.6.40\smb”') ] which is working , is not executed on the client web interface, is executed on the server !!!
for example, i have run dash app on windows server , and when the dcc.button is clicked and activate the subprocess.popen command, the command executed on the server system, because i found a lot of windows open on that path when i remote in.
So, is there any way to execute commands on the client side when dash app running on server ?
Thank you @jinnyzor.
We are in the middle of developing systems , and we have a mess in the team on how we provide information to each other, so i setup a dash server locally to redirect all the information from a central location, that resides on the SMB local server.
so the option of link ‘file://///…’ works perfect on firefox, it just needs to hit enter again and is able to browse the SMB server within firefox while using the client permissions.
for chrome clients, ‘file://…’ works when right click-> copy link and then paste in new window.
So if the target goes to folder, that method is browsing the folder, if path going to file, that file is opening, for example excel file. Is enough for our purpose ! Thanks a lot.
Is there any progress to the above?
I am trying to create a dcc.button that opens at the client machine the Windows Explorer pointing at a path, based on a dropdown box choice.