Open a .png with Photo Viewer from a web link


  1. Posts : 34
    Windows Home Premium 32bit
       #1

    Open a .png with Photo Viewer from a web link


    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


  2. Posts : 3,788
    win 8 32 bit
       #2

    You would have to set it in Firefox
      My Computer


  3. Posts : 2,468
    Windows 7 Ultimate x64
       #3

    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


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 23:24.
Find Us