dtr84664 2013-10-02 15:53 采纳率: 100%
浏览 177
已采纳

通过选择器的Google云端硬盘文件下载始终返回找不到的文件

I've now spent hours making this work and I'm running out of documentation to read on how to get such a simple process to work correctly. Here's my ideal situation.

I have a javascript version of the Google Drive picker (too me a couple hours to finally figured out the thing that I wanted google called the Google Picker API). Once I found it, it works like a charm and everything I ever hoped it would be. (kinda). What I need to have happen is the picker returns the file_id (which it does) and then I use that file ID in a php script to fetch the file through a wget call and then I save the file on my server. I haven't been able to get a curl request to work right so I used googles php library, which I'd rather not use, but whatever will make it work.

My glaringly huge problem is I have tried through the javascript api and the php api and even google's own explorer api and I get a file not found error on any file I choose from the several different google drive accounts I've attempted. I've been able to fix the myriad of descriptive (or lack thereof) errors and I'm finally settling down to this one error I cannot get passed. The javascript api returns a error 400 "Required Value: id" even though I know the value is getting populated correctly. The php library returns an error 404: File Not Found

I have Google Drive API enabled and running. I have Google Drive SDK enabled and appears to be working properly. I've read elsewhere that this could be a file permissions error, but I have no direction on how to correct this if it even is the problem.

For the record, I also had to do a dropbox integration, and entire integration from start to finish was less than 30 minutes.

Edit

Just in case I'm missing something with my api keys (there are way too many), for the picker, I need to the following from the Google Cloud interface. The .setDeveloperKey which is the Browser Key API Key, the .setAppId is the Oauth 2.0 client id.

When I setup the php library and am building up the client, $client->setClientId() is my Oauth 2.0 client id and $client->setDeveloperKey() is my Server Key API Key correct?

  • 写回答

2条回答 默认 最新

  • dongtui4038 2013-10-02 20:08
    关注

    You need to authorize and authenticate your requests on the behalf of the user, a key and your client ID will not be enough to access user's non-public document. Auth for PHP is explained on https://developers.google.com/drive/quickstart-php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏