title: How to Download a file with Google File Picker API?
body: <p>I've been following this <a href="https://gist.github.com/Daniel15/5994054]" rel="nofollow noreferrer">Google File Picker tutorial</a> and I've gotten so far as to get the file picker showing and getting the URL, but I don't know how to download the file using JavaScript. If I can use VB.NET, then can someone point me in the right direction?</p>
  
  <p>I've been able to download files with VB.NET from my own database, but I don't know how to get it with the Google API or with JavaScript.</p>
  
  <p>All of the file picker code works, and I'm calling this from the onSelect of the FilePicker:</p>
  
  <pre><code>function downloadGDriveFile(file) {
     if (file.downloadUrl) {
        var accessToken = gapi.auth.getToken().access_token;
        var xhr = new XMLHttpRequest();
        xhr.open('GET', file.downloadUrl);  // use selfLink??
        xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);
        xhr.onload = function () {
           var content = xhr.responseText;
        };
        xhr.onerror = function () {
           alert('Download failure.');
        };
        xhr.send();
     } else {
        alert('Unable to download file.');
     }
  }
  </code></pre>
  
  <p>And when I click on the download URL I get this error: </p>
  
  <pre><code>  "code": 403,
    "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
  </code></pre>