0

I have a custom Google search engine for images only. I want to make it so that when a user clicks on one of the images, the clicked image gets downloaded to the server.

How do I do this?

I have heard that you can use Javascript or JSON to do this but I am not exactly sure how.

Tried some Javascript - but it didn't work - it's my first time making a web app so I am new to this type of stuff

If you don't know what to do - can you please give me at least some sort of hint at what you think might be the solution to this


Update

Basically I want to save the image so that I can display it somewhere else in my website.

JoseBazBaz
  • 1,445
  • 4
  • 14
  • 23
  • This [Thread's](http://stackoverflow.com/a/3749395/1913975) answer may be the solution you are looking for. – abenrob Dec 21 '12 at 01:48
  • The image gets downloaded to _which_ server? – jdotjdot Dec 21 '12 at 03:24
  • My Heroku server/database I guess - basically I save the image so that I can display it somewhere else. – JoseBazBaz Dec 21 '12 at 04:21
  • Don't want to bother but be sure to not act against TOS (http://stackoverflow.com/questions/12797656/about-the-appropriate-usage-of-the-google-custom-search-api) – furins Dec 21 '12 at 04:35

1 Answers1

1

Try this may help you. Here image will be downloaded to specified location instead of server.

<div id="download">
    <img src="http://www.edudemic.com/wp-content/uploads/2014/05/google.jpg" id="image" />
    <a class="http://www.edudemic.com/wp-content/uploads/2014/05/google.jpg" download="smile.jpg">Download image</a>
</div>