How to open a local folder in explorer through a Chrome App Mode window?



FIRST: This is an internal use app that is developed with html, css, and js. Web dev conventions, user expectations does not exist. Capturing and changing typical behavior is OK, as this will not apply to normal web page design

I want to open up a folder (could be local, could be a network folder) from an html document. Any kind of hack/workaround is fine (i.e. html link, javascript function, etc), but the intent is that I have a series of links, some of which provide the user a quick way to access a specific folder without having to manually type or copy/paste the location into the address bar.

For instance, the location is displayed as \printer-folder. In Outlook, when creating a hyperlink, this works as expected.

How, if possible, can this behavior be replicated through Chrome? So far, I tried using href="//printer-folder", along with \printer-folder, using forward slashes, along with using file/// in front of it, along with trying with a Javascript function that uses window.open and all attempts result in trying to open a web page with the message “Your file couldn’t be accessed” and the error code “ERR_FILE_NOT_FOUND”. Are there any workarounds without disabling web-security on the command line?

Answer

you can do this in your html file

<form action="file://ip_addr/shared_folder/">
    <input type="submit" value="Go to folder" />
</form>

P.S. I think you must have the network share mounted on your computer, for example if you want to access to “192.168.1.55/file” you must at least mount a folder from 192.168.1.55 with the same credential of /file



Source: stackoverflow