title: Android - how to force Chrome browser to download file instead of passing it to Download manager
body: <p>First of all, I would like to clarify that I'm not an Android device user, I'm a web developer. </p>
  
  <p>Secondly, I tried searching around internet and consult other questions, but they didn't help.
  My problem is: In my page, I want user to download a <code>.pdf</code> file by using this script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function handleDownload() {
      window.location.replace('./link/to/file.pdf');
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>When user clicks on 'Download' button, <code>handleDownload()</code> is trigger, it's OK on Windows browsers like Firefox, Chrome, but for Chrome on Android, it opens the link by Android Download manager.</p>
  
  <p>The problem is that Android Download manager doesn't have same session ID with Chrome, thus it is not logged in, and failed to download <code>.pdf</code> file.
  When I try to download a <code>.pdf</code> file from Google Drive, it is downloaded by Chrome, not the Download Manager, so I believe there is a way (probably a special HTTP header) to do this.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>It seems that problem is caused by my user use a external download manager (ESDownloadManager). After he uninstalled this app, the Session problem's gone.</p>
  
  <p>Have a nice day all.</p>