1

In my web-app (WebPages, C#.NET) I have a drag and drop file box where user's can drag files from windows explorer and, once dropped, it will save in a given location on a shared drive. This part is working fine. The box looks something like this:

enter image description here

The problem is, that it also reads files from the same directory and my user's would like to be able to open the files from this interface on dblclick. I have written an ajax request with jquery (the ajax, too, is working fine), but I can't seem to get the files to open on the user's machine no matter what I try.

Most references I try and look up point me towards System.Diagnostics.Process.Start(@"<directory goes here>") but this doesn't really do anything. It will open some process on the server side, but nothing opens, either on the server or on the user's machine.

What they'd like to do, for instance, is double click 'Hazcom.xls' and it would use the default associated application to open the file. In this case, of course, Microsoft Excel.

Is this even possible or am I chasing a wild goose here?

Sources I've Tried:

There have been a few more sources I've tried, as well, but they're all pretty much in the same vein as these.

Additional Info:

  • The internal Intranet application runs on a server using IIS 8
  • The solution is desired to be opened on the user's machine and not, say, the server itself.
  • The path to the files is dynamically changing depending on what they have loaded into the interface.
  • Though, I'm not expecting this to be a solution viable for client side (jquery) I'd be happy to look into that if that's the only solution available.
  • I'd also settle for simply opening the file location, instead of the actual file itself, but I've had no luck with this either, for what looks like the same reasons as the original problem.
halfer
  • 19,824
  • 17
  • 99
  • 186
VoidKing
  • 6,282
  • 9
  • 49
  • 81
  • 3
    You can't. The webserver does not have access to the local machine. – VDWWD Sep 05 '17 at 18:40
  • @VDWWD That makes sense. Is there anyway to do this with client side code, or is that really not possible due to security issues? – VoidKing Sep 05 '17 at 18:42
  • I don't think so. At least not normally apart from a file selector. And when you do you are going into the realm of malware/virus software. – VDWWD Sep 05 '17 at 18:46
  • @VDWWD That's what I was afraid of. My client is just going to have to suffer the reality of this particular scenario/environment. Thank you so much for the help, Sir! – VoidKing Sep 05 '17 at 18:48
  • SharePoint has this functionality, but only with Internet Explorer. I believe it is achieved using WebDav with Web Folders. Here is a link which shows you how to setup a WebDav server https://www.webdavsystem.com/server/server_examples/sql_storage/ – WithMetta Sep 05 '17 at 21:09
  • 2
    A simple solution is just to download the file on doubleclick and then the user can open it from the browser by clicking on the downloaded document, as you usually would do. Maybe ActiveX also could be what you're looking for. only works in in IE and is a old solution. Btw, he reason nothing happens on serverside when you run process.start is that the "user" running IISprocess don't have permission to start the program – user3532232 Sep 06 '17 at 11:28
  • @user3532232 thank you for the information! Very helpful. – VoidKing Sep 07 '17 at 13:14
  • @WithMetta Thank you for the info! Unfortunately, this is a Chrome environment, but I will keep that in mind for future reference. – VoidKing Sep 07 '17 at 13:15
  • To a certain extent, this limitation is by design. Otherwise, it'd be pretty easy for websites to scour users' disks for interesting information. – 3Dave Nov 25 '19 at 23:46

0 Answers0