I have a mobile html page which contains images. I want to create a button or a link which is used for a download of an image. The image should then be saved to the users mobile
Support for download attribute: http://caniuse.com/download
You can set headers on the server, if that's an option for you. The HTTP header you want to send is Content-Disposition: attachment; filename="imagename.jpg".
Differs depending on your server..
In Node/Express:
// only on imgs
function(req, res){
res.setHeader('Content-disposition', 'attachment; filename=imagename.jpg');
}
In the HTML:
Download link
Server will send Content-Disposition header when it gets the request for the file and force browsers to download.