views:

129

answers:

3

Is there a smart way to - from a browser - open hrefs to text files and XML files in an external program. My target platform is Win32 so preferably I'd have the files open in the default editor for it (as set in explorer.exe).

The solution must work in Firefox. It's a bonus if it works in IE and Crome.

My html is generated from a local developer database for files on disk. I.e. hrefs look like this: file://c:/a/b/c.ext. Currently, Firefox and IE show their built-in XML viewer, and god knows what Chrome is showing (looks like random XML excerpts to me).

I don't know if this is of any relevance, but all hrefs are of type <map><area href/></map> (over an image) and not just simple <a href/>s.

Edit: is it possible in Javascript, anyone?

A: 

When you are dealing with links to files, you cannot change the launch application on the server side of things. This would be a behavior that the user would need to configure on their side via the settings of their browser.

Mitchel Sellers
You wouldn't happen to know how it's done in FF?
Jonas Byström
Tools -> Options -> Applications. But it doesn't like there is an option for .txt
Mitchel Sellers
I can't get .xml to open in a separate viewer either. Do you know how to fix that?
Jonas Byström
A: 

I am no html expert, but maybe you should just change the link from a href to a download. Textfiles i.e. should then be opened with notepads.

RED SOFT ADAIR
I don't like the idea of people downloading local files from their C: to their C:. The idea was that they'd be able to edit their local files (using preferred editor) when clicked upon in the browser.
Jonas Byström
A: 

It does not seem possible to solve (easily). I give up.

Jonas Byström