title: How can I create an Image Download Link in HTML for a Mobile Page?
body: <p>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 image gallery. </p>
  
  <p>I have seen this post: <a href="https://stackoverflow.com/questions/2793751/how-can-i-create-download-link-in-html">How can I create download link in html?</a></p>
  
  <p>The solution </p>
  
  <pre><code>&lt;a href="link/to/your/download/file" download="filename"&gt;Download link&lt;/a&gt;
  </code></pre>
  
  <p>is working in desktop browsers but not on mobile. </p>
  
  <p>Here is a JSFiddle I made: <a href="http://jsfiddle.net/tDVqH/4/" rel="nofollow noreferrer">http://jsfiddle.net/tDVqH/4/</a></p>
  
  <p>Note: The image is created in the browser i.e., in a HTML5 canvas element. This image can be generated with canvas.toDataUrl(). The resulting image should be saved to the mobile image gallery.</p>
  
  <p><strong>How can save an image to the users mobile image gallery with a click/tap? Is there a JavaScript solution without the ser round trip with a unknown header?</strong></p>
  
  <p>Edit: I also found the following questions but they do not have an answer. <a href="https://stackoverflow.com/questions/9130258/save-an-image-to-the-local-folder-from-the-website-by-clicking-a-link-or-buton-i?rq=1">Save an image to the local folder from the website by clicking a link or button in mobile browser</a> and <a href="https://stackoverflow.com/questions/17749145/save-an-image-to-a-mobile-phone-gallery-from-a-browser">Save an image to a mobile phone gallery from a browser</a></p>