Looking for a "better" way to have the browser launch an external media player
I'm working on an internal website for my company. I need a way for a user to click on a link & launch an external media player.
I'm currently doing it by making up a mime type called "application/bash", setting each user's firefox to open content of "application/bash" with bash, then simply writing a command to the "file" that's downloaded (i.e. a bash script)... so when the user clicks the link, their browser sends the content to bash, bash runs the script which calls the media player, and the media player plays.
This works fairly well, but it feels super hacky, not to mention the security risks involved, especially considering the file to open is url encoded in the request (i.e. in the GET). (I do take care to check that the file requested exists before packaging up the bash script for download & that it doesn't contain any funky characters like ';' but still).
With all that said, is there a more "legitimate" way to get the browser to launch an external application? While security is always a concern, it's a little less of a concern in this case as this is an internal site - only viewable from within the building, so I can let a few things slide if need be (though I'd rather not).
|