title: Downloading Image not Working in Mobile Browser
body: <p>Here is my script for Downloading an image working perfectly on Computer, But It's not working in Mobile Browsers,Nothing takes place when clicking the Button</p>
  <p>Function</p>
  <pre><code>&lt;script&gt;
  function forceDownload(url, fileName){
      var xhr = new XMLHttpRequest();
      xhr.open(&quot;GET&quot;, url, true);
      xhr.responseType = &quot;blob&quot;;
      xhr.onload = function(){
          var urlCreator = window.URL || window.webkitURL;
          var imageUrl = urlCreator.createObjectURL(this.response);
          var tag = document.createElement('a');
          tag.href = imageUrl;
          tag.download = fileName;
          document.body.appendChild(tag);
          tag.click();
          document.body.removeChild(tag);
      }
      xhr.send();
  }
  &lt;/script&gt;
  </code></pre>
  <p>The HTML Script</p>
  <pre><code>&lt;button onclick=forceDownload(&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png&quot;,&quot;Test&quot;) type=&quot;button&quot;&gt;Download&lt;/button&gt;&lt;/a&gt;
  </code></pre>