I have this scenario. I have a JSP page(First.jsp) in which I have my buttons. I am including another JSP page(Second.jsp) in First.jsp which contains an image. When I click on a button in my First.jsp, I want the image in Second.jsp to be downloaded. How can I do this? I have the following which downloads the image in the same page. DEMO
<div id="download">
<img src="http://www.glamquotes.com/wp-content/uploads/2011/11/smile.jpg" id="image" />
<a class="button" href="http://www.glamquotes.com/wp-content/uploads/2011/11/smile.jpg" download="smile.jpg">Download image</a>
</div>
CSS:
#image{
height:250px;
width:250px;
float:left;
}
#dwnld{
float:left;
}
.button {
appearance: button;
-moz-appearance: button;
-webkit-appearance: button;
text-decoration: none; font: menu; color: ButtonText;
display: inline-block; padding: 2px 8px;
font-size: 15px;
}