I have a partialView which lists out filepaths and I need to be able to click on that path and open the containing folder.
The app was working locally and process.start() worked just fine until we moved to a production server and now a solution is needed for it.
The browsers security restrictions won't allow me to open the containing folder directly.
Is there a way to accomplish this?
Current setup, pretty basic stuff
public ActionResult OpenFile(string path, int someId)
{
Process.Start("explorer.exe", Path.GetDirectoryName(path));
The view looks like this
@foreach (var file in Model.FileSet)
{
var path = @file.FilePath;
@file.FilePath @file.FileType@file.Created}
Any help is appreciated.
Solutions1
The code Process.Start is done on server side and even probably works if you check server process list.
You can only add download functionality, but I don't know if this fulfills your requirements.
Talk1:
Thanks @Garath,The files are downloaded through a separate process and reside on the client machine. The file location is stored in the database and listed on the app. So, something that can open files on the local client machine is what i am looking for.
Talk3:
I did look at it before posting my question but thought there's someone out there who encountered this and resolved it.
Talk4:
it cannot be resolved because in all browser, because most of them just block this because of security reasons. If you really need such functionality the only option is to use java applet and communicate with it using javascript.