href image link download on click

Posted by Piero on Stack Overflow See other posts from Stack Overflow or by Piero
Published on 2010-03-09T10:09:29Z Indexed on 2010/03/09 10:21 UTC
Read the original article Hit count: 374

Filed under:
|
|
|

Hey all,

I generate normal links like: <a href="/path/to/image"><img src="/path/to/image" /></a> in a web app.

When I click on the link, it displays the picture in a new page. If you want to save the picture, then you need to right click on it and select "save as"

I don't want this behaviour, I would like to have a download box popping out when I click on the link, is that possible just with html or javascript? How?

If not I guess I would have to write a download.php scrit and call it into the href with the file name as parameter...?

Greetings! :)

© Stack Overflow or respective owner

Related posts about html

Related posts about href