0

I'm not expert in Asp.net MVC5 technology, but I have a task to accomplish using it.

I have a local folder that I need to open from my application. this is the address of my folder: file:///C:/Users/Daoud/Desktop/Stressing/.

Now if I copy this address to the browsers (IE, Chrome, Firefox) it works just fine. However if I put it in my application on html button as below, it never works:

<a class="btn btn-primary" href="file://C:\Users\Daoud\Desktop\Stressing\">Stressing &raquo;</a>

It seems to me very weird, since the same address is opening when copying directly to the browser address, while it is not working when using in HTML button.

halfer
  • 19,824
  • 17
  • 99
  • 186
Davideg
  • 841
  • 4
  • 14
  • 23
  • This has nothing to do with ASP.NET. It's HTML and browsers. Most browsers won't let you. – Quentin May 24 '16 at 08:04
  • … and that is a link, not a button. – Quentin May 24 '16 at 08:04
  • Sorry for the inconvenient....I just read many posted questions and answers, and no one is mentioning my case...so please give me some space to get help.... – Davideg May 24 '16 at 08:59
  • what I`m asking is how to open a directory and not a file.... knowing that pasting the path into the browser is working while using it in html link is not... I just need help to let this works as an HTML Link... – Davideg May 24 '16 at 09:01
  • Directories are just a type of file. As the accepted answer to the duplicate questions says: "Some browsers, like modern versions of Chrome, will even refuse to cross from the http protocol to the file protocol, so you'd better make sure you open this locally using the file protocol if you want to do this stuff at all." You aren't working locally. I know you are using HTTP (or HTTPS) because you can't do ASP.NET without it. You can't link from your website to a local directory. – Quentin May 24 '16 at 09:03
  • Is it possible to create a virtual directory to the physical path in the website in IIS, and then open the folder through the VD.. – Davideg May 24 '16 at 09:07
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/112759/discussion-between-davideg-and-quentin). – Davideg May 24 '16 at 09:10

0 Answers0