可恢复的上传错误401 [英] Resumable upload error 401
问题描述
简要的结果如下:
情景1
- 获取访问令牌。
- 开始上传。 当访问令牌未过期时,您可以停止上传并按照这里没有问题,(即使我在请求一个新的访问令牌的时间内,初始访问令牌没有过期(一个开始上传),所以这个新的访问令牌我可以继续上传,但只有在初始访问令牌未过期的情况下, 才能继续上传 )。
情景2
- 获取访问令牌。
- 开始上传。
- 访问令牌已过期。
- 使用刷新令牌获取新的访问令牌。
- 继续上传。 WWW-Authenticate:Bearer realm =https://accounts.google.com/AuthSubRequest,error = invalid_token 收到 401 / strong> - 发生错误始终,而有步骤3和4。 结论: 由于访问令牌有效期为一小时,因此无法上传大文件(例如,如果此文件的上载时间超过1小时,或上载文件时访问令牌已过期)。
问题: 这个结论是否正确? 为什么? 这是Google云端硬盘错误,我无法像上面描述的那样上传一个大文件? 谢谢。 这篇问题
a>已经出现一年多了。我们的解决方法是对大文件使用旧API (这就是Google Drive客户端仍然使用)。
I carefully tested big files resumable upload.
Briefly results are the following:
Scenario 1
- Obtain an access token.
- Start uploading.
- While access token not expired, you can stop the upload and resume it again as described here with no problem, (even if I request a new access token, during the period initial access token has not expired (one which began uploading), so with this new access token I can continue uploading, BUT again only during the period initial access token has not expired).
Scenario 2
- Obtain access token.
- Start uploading.
- Access token expired.
- Obtain a new access token using the refresh token.
- Continue uplolading.
- Received a 401 error WWW-Authenticate: Bearer realm ="https://accounts.google.com/AuthSubRequest ", error = invalid_token - error occurs ALWAYS while there are steps 3 and 4.
Conclusion: since access token is valid for one hour, you can not upload a big file (in case of the upload time of this file exceeds 1 hour, for example, or access token has expired while you uploading the file).
Questions:
Is this conclusion right?
Why?
Is this the Google Drive error and really I can not upload a big file as described above?
Thanks.
This issue has been present for more than a year. Our workaround is to just use the old API for big files (that's what the Google Drive client uses anyway).
这篇关于可恢复的上传错误401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!