title: Download images using HTML or JavaScript
body: <p>I need to download images from the server. In the below HTML5 code 'Download 1' downloads the image successfully. But 'Download 2' is navigating to the image URL instead of downloading the image. The main difference between 'Download 1' and 'Download 2' is 'Download 2' has file extension as'.jpg' in the file name. I want 'Download 2' to download the image.</p>
  
  <p>I need to download images with the file extension. Please help to resolve the issue. Thanks in advance! </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a id="download_image" href="https://docs.google.com/uc?id=0B0jH18Lft7ypSmRjdWg1c082Y2M" download&gt;Download 1&lt;/a&gt;
  &lt;a id="download_image" href="https://www.w3schools.com/html/pic_trulli.jpg" download&gt;Download 2&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>