Basically, I'm creating a webpage filled with images of movie posters that link to video files, as a means of making a more visually-appealing form of my local video library.
I'm using
<a href="C:\blah\movie.mkv"><img src="poster.jpg">
It works exactly how I want, HOWEVER, it opens the file in the browser rather than opening it in its default program, as I would like. I would like each link to open the file in the program titled "VLC Media Player", as specified in Windows for each of their filetypes.
Let me know how I can do this (in the simplest form--I'm not too smart :P)
Thanks!
-
1Are you making a local website? You know, in an actual website, you'll need the client to download the actual file. If you're only going to use it locally, it's fine :)Madara's Ghost– Madara's Ghost2012年12月29日 09:35:42 +00:00Commented Dec 29, 2012 at 9:35
-
I'm just using my own Windows computer. The webpage is for personal use only.Bobazonski– Bobazonski2012年12月29日 09:54:51 +00:00Commented Dec 29, 2012 at 9:54
-
This question is similar to: open a file with its default programme. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.RokeJulianLockhart– RokeJulianLockhart2024年10月24日 17:14:41 +00:00Commented Oct 24, 2024 at 17:14
2 Answers 2
If you are creating web pages on your local system for you own use then you may want to consider looking in to a WAMP server setup. This uses php and should allow you to call VLC using the exec command. Would take some learning however.
Comments
There is very little you can do to control how a client will handle a resource.
You can use the Content-Disposition HTTP response header to state that the resource is an attachment (and thus recommend that it be downloaded instead of opened).
Content-Disposition: attachment;filename="movie.mkv"
You can't, however, stop browser native support or a plug-in from handling something instead of having it open in a separate application (let alone cause it to be opened in a specific application).
If the browser is configured to open video files internally, then nothing the author of a website can do will make it switch to using a application instead.