Code to download an image without having to right click a link?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • w33nie
    New Member
    • Jan 2007
    • 56

    Code to download an image without having to right click a link?

    I was wondering what I would need to do to make a link, when clicked, download an image with the save as window, instead of just loading the image inside the browser.
    I also don't want to have to right click the link & click save as
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    You can't with html/css without setting options in the browser.

    Comment

    • w33nie
      New Member
      • Jan 2007
      • 56

      #3
      Is there any way to at all?

      Comment

      • eWish
        Recognized Expert Contributor
        • Jul 2007
        • 973

        #4
        I would think that you could zip your image file and then you should be able to download the file.

        --Kevin

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          By default, browsers are set to open files with image name extensions in a browser window. If you wanted, say a .jpeg file, to be downloaded instead, you would need to tell the browser to not display .jpeg files, but then it would never display jpegs.

          Whether or not this can be done with javascript, you would need to ask on that board.

          Comment

          Working...