title: Google Drive API returning 404 on upload
body: <p>I'm trying to upload data to a file using the Google Drive v3 API by making a XMLHttpRequest.</p>
  
  <p>I get the id of a file using the File Picker API which returns "0BzAI5S8IJebrUnQtYWFSVzhPdVk", so that the upload URL should be "<a href="https://www.googleapis.com/upload/drive/v3/files/0BzAI5S8IJebrUnQtYWFSVzhPdVk?uploadType=resumable" rel="nofollow noreferrer">https://www.googleapis.com/upload/drive/v3/files/0BzAI5S8IJebrUnQtYWFSVzhPdVk?uploadType=resumable</a>".</p>
  
  <p>After I make the PUT request, it returns a 404 status code with "Not Found" as the responseText.</p>
  
  <p>I've tried it before and it would return with status 200 and I was able to get the Location header from the response, but now I can't get a 200 status code from any file.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>// Log the user in using attachClickHandler (https://developers.google.com/identity/sign-in/web/reference#googleauthattachclickhandlercontainer-options--onsuccess-onfailure)
  
  var id = "0BzAI5S8IJebrOFVMTU5Od183Q2M";
  var access_token = gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().access_token;
  
  var xhr = new XMLHttpRequest();
  
  xhr.open('PUT', 'https://www.googleapis.com/upload/drive/v3/files/' + id + '?uploadType=resumable');
  xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);
  
  xhr.onreadystatechange = function() {
      if (this.readyState == 4) console.log(this.status);
  };
  xhr.send();
  </code></pre>
  
  <p>No matter which file I choose, it always outputs 404 as the status code. I follow what it says at <a href="https://developers.google.com/drive/v3/web/resumable-upload" rel="nofollow noreferrer">https://developers.google.com/drive/v3/web/resumable-upload</a>, but it mentions nothing of why you would receive a 404 response. Any help?</p>