Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:09:47+00:00 2026-05-28T01:09:47+00:00

Ive got images on my website. I would like to create functionality that if

  • 0

Ive got images on my website. I would like to create functionality that if user clicks on that image save as window appear and the one can save image.

I wrote something like this:

<a href="/foto1.png" target="_blank">
   <img src="/foto1.png" alt="" />
</a>

And it works but opens new tab till user clicks save or close save as window. Is it possible to get rid of new tab ?

Thanks for any suggestions

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:09:47+00:00Added an answer on May 28, 2026 at 1:09 am

    i would change your mark up and include all the images you want saved in one container, this however will only work in IE i’m afraid so:

    <div id="imagesToSave">
        <a href="/foto1.png" target="_blank">
           <img src="/foto1.png" alt="" />
        </a>
    </div>
    

    Then with jquery use this code:

    $('#imagesToSave img').click(function(){
        document.execCommand('SaveAs',true,'file.html');
    });
    

    For another browsers, which you’ll obviously want to do think about this by Craig Stuntz:

    hyperlinking to the img file and setting the content-type and content-disposition headers in the server response. Try, e.g., application/x-download, plus the other headers specified here.

    good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an MVC3 website that allows users to upload images. If a user
I've got a nice image on my website that has a play button on
I have a website that generates polaroid-like images stacked on eachother at different angles.
I've got a script that dynamically calls and displays images from a directory, what
I've got a routine that grabs a list of all images in a directory,
I've got an app that is heavily based on remote images. They are usually
I've got different users for my website, owning different images which are all stored
I've got a website that is running WordPress. It has several pictures that I
I've got a .net 3.5 website I've got two types of page, ones that
I've got a simple question :) Hopefully. So, I wan't to repeat a website-background-image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.