可恢复的上传错误401 [英] Resumable upload error 401

查看:459
本文介绍了可恢复的上传错误401的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仔细测试了大文件可恢复上传。

简要的结果如下:

情景1


  1. 获取访问令牌。

  2. 开始上传。 当访问令牌未过期时,您可以停止上传并按照这里没有问题,(即使我在请求一个新的访问令牌的时间内,初始访问令牌没有过期(一个开始上传),所以这个新的访问令牌我可以继续上传,但只有在初始访问令牌未过期的情况下, 才能继续上传
  3. )。

情景2


  1. 获取访问令牌。

  2. 开始上传。

  3. 访问令牌已过期。

  4. 使用刷新令牌获取新的访问令牌。

  5. 继续上传。 WWW-Authenticate:Bearer realm =https://accounts.google.com/AuthSubRequest,error = invalid_token
  6. 收到 401 / strong> - 发生错误始终,而有步骤3和4。 结论: 由于访问令牌有效期为一小时,因此无法上传大文件(例如,如果此文件的上载时间超过1小时,或上载文件时访问令牌已过期)。



    问题:

    这个结论是否正确?

    为什么?

    这是Google云端硬盘错误,我无法像上面描述的那样上传一个大文件?



    谢谢。

    解决方案

    这篇问题

a>已经出现一年多了。我们的解决方法是对大文件使用旧API (这就是Google Drive客户端仍然使用)。


I carefully tested big files resumable upload.

Briefly results are the following:

Scenario 1

  1. Obtain an access token.
  2. Start uploading.
  3. 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

  1. Obtain access token.
  2. Start uploading.
  3. Access token expired.
  4. Obtain a new access token using the refresh token.
  5. Continue uplolading.
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆