Open a .png with Photo Viewer from a web link

rhinse

New member
Local time
9:15 PM
Messages
34
I have an unusual request. I would like to use Photo Viewer to open a .png file which is
referenced by a link in a web page. This png file resides on my computer and will open
by default with Photo Viewer if clicked on in Explorer. The web page link I have been trying
looks like:


<a href="file:///C:/images/file.png">Image</a>


This will open the file in a separate web page but as a static image with no way to zoom
as in Photo Viewer. I don't want to alter the behavior of Firefox when a png image is presented
in a web page (i.e. use Photo Viewer); that would be disastrous and I'm not sure it can be done
anyway.



How can I make this web link open the image file with Photo Viewer?
 

My Computer My Computer

At a glance

Windows Home Premium 32bitAMD Athlon II X2 255 Regor 3.1GHz Socket AM3Kingston ValueRAM 2GB (2x1GB) DDR3 1333 Dual ...Sapphire 100287L Radeon HD5670 512MB PCI Expr...
Computer Manufacturer/Model Number
Custom
OS
Windows Home Premium 32bit
CPU
AMD Athlon II X2 255 Regor 3.1GHz Socket AM3
Motherboard
Gigabyte GA-870A-UD3 Rev.2.1
Memory
Kingston ValueRAM 2GB (2x1GB) DDR3 1333 Dual Channel
Graphics Card(s)
Sapphire 100287L Radeon HD5670 512MB PCI Express 2.0 x16
Sound Card
Realtek onboard
Monitor(s) Displays
Samsung 56" HDTV
Hard Drives
Western Digital 3.5" 640GB SATA
PSU
Black Cooler Master eXtreme Power Plus 500W ATX12V V2.3
Case
Black Logisys Ikonik Taran A10 Mid Tower
Cooling
AMD CPU cooler, 2 120mm case fans
You would have to set it in Firefox
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
The HTML standard and web browsers in particular are specifically designed to avoid what you want. If any website could open a program on your computer, it would be security chaos!

If all you want is to be able to zoom the image, that's a browser capatility, so, use a different browser or add a plugin for your current one and you're done.

If not, there are still a couple of ways you can get that to work, always including modifications to your local system and the HTML markup.
Have a look here: Force to open "Save As..." popup open at text link click for PDF in HTML - Stack Overflow
Basically it boils down to trying one of those alternatives. Put a "download" attribute in the link (which some browsers may ignore):
Code:
<a href="file:///C:/images/file.png" download>Image</a>
Then when asked by the browser, chose open instead of save and your default program for handling images will open it.

Another option is to register a new protocol and use it to open your program. Look at here: windows - How do I create my own URL protocol? (e.g. so://...) - Stack Overflow
Here you need to change the HTML to use your specific protocol, say like this:
Code:
<a href="photoviewer://C:/images/file.png">Image</a>

Then you would need to add the "photoviewer" protocol to the registry and make it open the file it receives. This will only work in the system it's made such modification.

Other than those dirty tricks, it isn't possible with normal HTML.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Core i7-740QM8 GB DDR3NVIDIA GeForce 330GT
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Back
Top