cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open with file explorer from anchor tag

Open with file explorer from anchor tag

kevin g.1
Helpful | Level 6
Go to solution

Hi,

    Is it possible to implement the "show in file explorer" option for folders from our own website similar to how it's done on dropbox.com?  Our current workflow has us clicking on a link to take us to the folder on dropbox.com then opening it in file explorer. I'd like to skip the middleman if that's possible. Thanks!

11 Replies 11

Tech Dev Oldsmar
Helpful | Level 5

I actually came up with a decent method of opening the Windows File Explorer having the synchronized DropBox files on the client from a website.  In this case, the website is running Blazor Server in .NET 7.  I create a SignalR Hub to which a small Windows Form application subscribes. 

using Microsoft.AspNetCore.SignalR.Client;
//replace localhost:7083 with your production URL
hubConnection1 = await ConnectToHub("https://localhost:7083/messageHub");

 

The website (using the DBX API) passes via SignalR the folder path and a userID to the Windows Form app. 

 

   var hubConnection = new HubConnectionBuilder()
       .WithUrl(url)
       .WithAutomaticReconnect()
       .Build();
   hubConnection.On<string, string>("ReceiveMessage", (message, userEmail) => 
// process received data from website....

 

The Windows Form app checks that the userID matches and then opens the path to the local DBX files:

 

 System.Diagnostics.Process.Start("explorer.exe", fullPath);

 

Because sometimes people install the DBX client in wacky places I also have a textbox in the Windows Form app that allows them to set the path to a Teams root folder (e.g., "C:\Users\userName\DropboxTeam\CompanyShare"

 

On the Blazor side:

 

@using Microsoft.AspNetCore.SignalR
// Link a method to a button click that calls:
 await HubContext.Clients.All.SendAsync("ReceiveMessage", dbxLocalPath, myUser.EmployeeEmail);
// in Program.cs don't forget:
using Microsoft.AspNetCore.SignalR;
builder.Services.AddSignalR();
app.MapHub<MessageHub>("/messageHub");
//Finally, make sure you have a Hub in your Blazor Server:
 public class MessageHub : Hub
 {
     public async Task SendMessage(string message)
     {
         await Clients.All.SendAsync("ReceiveMessage", message);
     }
 }

So the overall idea is that you have users with a little WinForm client receiving messages from BlazorServer to open file directories. Blazor sends a userID which you check matches the local WinForm client. Otherwise, all your users have File Explorer open when any one requests it from the website.  

lt6_la
New member | Level 2

it is impossible to search such a like on dropbox, explorer  is the window program ,but drop box is cloud environment with network.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    lt6_la New member | Level 2
  • User avatar
    Tech Dev Oldsmar Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?