Open Windows Explorer via Link

Hi Vaadin-Pros out there.

As the header says, I need to open a Windows Explorer window via a Link. Has anybody of you done that before and can give me a hint?

Besides a lot of other things I have tried the following. I am pretty sure that the link itself is correct (the five slashes, etc.) but it does not work.

Label lbl = new Label();
lbl.setValue("<a href=\"file://///server123/appfolder\">Windows Explorer Folder</a>");

I came across this
during searching the internet as I am using Firefox. So I am aware of the security purposes. But it does not work in IE 8 either.

Thanks for your help in advance.


Unfortunately, this is a tricky. I’ve bumped into this before - essentially, file links are different for different browsers.

wikipedia entry on the file URI
has examples of the correct format for both IE & Firefox.

If the files are on a server AND that server is accessible to the web application, then you could probably access them in a consistent form from the web application, and stream them to the browser.

Either that, or present a different URL based upon which browser is being used.

Doh. I’ve just reread your original message - you want to open an Windows Explorer window pointed to a directory based on a URL? I’ve never done that.

A quick check shows that file://server123/appfolder works on IE (well, IE9 which is what I have). I’m not sure what will work on FF. I’d try following the logic in the wikipedia entry, and see if that helps.

Sorry. I’ll leave the original response, as it may be of use to others



Charles, thanks for your help.

The last 24 hours I tried and tried and tried and tried. But nothing worked. I searched the internet did this and that, edited the security rules of IE and FF, but still no luck. Till I finally decided to reinstall IE and FF. And guess what, after that and of course after adjusting the security settings to “Intranet” for IE and according to the site I mentioned above for FF it works. Guess something was really messed on my computer.

I am sorry for wasting your time.


Some additional info in case someone who wants to do something similar is stumbling over this post:

FF opens a window showing the content of the folder only. FF is not capable to act as a Windows Explorer like IE. A workaround is to install
IE Tab2
. By opening your local file system link with IE Tab2 you get all the functionality you would have if you opened the Link in IE itself.

By the way, the code snipped I gave is correct.