2

I have seen discussion in internet about problems (or bugs in Google Drive SDK ) with resumable uploading to google Drive https://developers.google.com/drive/web/manage-uploads#resumable

and the problem with access_token when it expires after one hour ..

Is there a possibility now ( I understood there should be ) to refresh access token for this ongoing upload ?

I did the test implementation for this but it did not work, when I updated the refreshed access token?

but is this now bug in my code or google drive side ?

Artjom B.
  • 61,146
  • 24
  • 125
  • 222

1 Answers1

1

If you abandon the library, and simply call the REST API directly, you can implement your own 401 error handling.

edit; see comments below which suggest that the problem is a bug which cannot be circumvented

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • I am calling REST API directly , and then when "unauthrorized error" comes, I get new access token with help of refresh token, and then try to use that in coming requests .. but that does not seem to go as I thought. So you have managet to get this working okay? – Jarno Lavikonmäki Jan 23 '14 at 08:55
  • How are you using the access token and what error are you getting? – pinoyyid Jan 23 '14 at 10:38
  • 1. First sending post request with uploadType resumable with content length and X-Upload-Content-Length and -Type 2. Then from the response I pick the "location" url from header 3. Then start sending chunks of files in put requests to "location url" and putting Content-Range header to request 4. Then when failure comes after 1 hour, I get the new access token , update it to "location" url and continue, and this continuation fails – Jarno Lavikonmäki Jan 23 '14 at 11:03
  • the two failures in step 4 are both 401? Can you paste the url after you've updated it? have you tried setting the access token as an HTTP header rather than encode it in the URL? – pinoyyid Jan 23 '14 at 14:49
  • Yes , errors were the same. Putting access token to HTTP header I have not tried yet and I have not seen the documentation to tell to do it that way. I saw similar issue ( https://code.google.com/p/gdata-issues/issues/detail?id=5124 ) as reported error, not sure if that could be the same issue . So you have not done the similar impl yet ? – Jarno Lavikonmäki Jan 24 '14 at 12:28
  • Just read the bug report and it seems to match your symptoms. It's prob worth trying to set the auth header (Authorization: Bearer access_token) just in case. Otherwise star the bug and wait ... and wait – pinoyyid Jan 24 '14 at 12:31
  • It's pretty mich the same issue you've found in the issue tracker. The problem is on the drive/YouTube endpoint and can't be fixed with code. Use Api v2 and take this bug, or switch back to probably working Api v1 if possible. – Dennis Fischer Jan 24 '14 at 12:54
  • Dennis Fischer , question about your comment "use Api v2 and take this bug?" what did you mean by that, reporting error somewhere ? – Jarno Lavikonmäki Jan 27 '14 at 06:09
  • so is there any activity at Google Drive / Google team related to this ? Quite an annoying error and I would hope to see some comments what's going on with this – Jarno Lavikonmäki Feb 05 '14 at 11:12