duankui6150 2015-05-26 07:52
浏览 315

下载文件时出现Google Drive 403错误

i have problem with google drive

first of all I created an account on admin.google.com

there I got the credentials for service account and implemented them in my php application,

is enabled Drive API and Drive SDK it works fine with upload and getting the files from drive.

but when i wont to download it writes 403

  1. That’s an error.

We're sorry, but you do not have access to this page. That’s all we know.

I tried to download int 2 methods:

  1. $downloadUrl = $file->getWebContentLink(); - error 403

Second:

  if ($downloadUrl) {
            $request = new Google_Http_Request($downloadUrl, 'GET', null, null);
            $httpRequest = $service->getClient()->getAuth()->authenticatedRequest($request);
            //return Redirect::to( $downloadUrl);
            if ($httpRequest->getResponseHttpCode() == 200) {
                return $httpRequest->getResponseBody();
            } else {
                // An error occurred.
                return null;
            }
        } else {
            // The file doesn't have any content stored on Drive.
            return null;
        }
  • returns content of the file but wont download

if i access direct download link - its blank page

then i red in the internet that i need to delegate rights for my client id and i did it manage api clients

but the problem didn't disappear.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog