Can't retrieve file content via download URL

2019-02-26 18:39发布

问题:

Since about an hour, I can't retrieve file content via the download URL attribute.

Each time I try to get it, API answers a 401 (unauthorized error).

Here's the code used: https://gist.github.com/arnaudbreton/5409015 Credentials are stored in GAE datastore and successfully retrieved / refresh. The first call to file endpoint is working but not the second call to download content.

It was working this morning. I tried different things so far: - Revoke client secret (found as a solution in an other thread) - Create a new client to test - Disconnect my APP from Drive, accept it again

Nothing seems to solve my issue.

Thanks for your help.

回答1:

A fix/rollback is in progress, should be back to normal soon.



回答2:

You can use

resp.alternateLink;
resp.webContentLink;

i got stucked in the same issue a day back , using downloadUrl to get the content but got it with webContentLink.

var request = gapi.client.drive.files.list();
                request.execute(function (resp) {

resp.alternateLink;
    resp.webContentLink;
});