English 中文(简体)
转自权驱动器
原标题:Retrieve file metadata from google drive api

I m致力于一个网站,让用户看到他存储在google发动机上的录像文档,并与1 html5的参与者一起使用。

我利用谷歌·皮克尔展示用户档案。 在收集档案时,用户被转往像我的档案一样的ur。 php?id={file_id}

在着陆页上,如果我使用下文中类似的代码,我会收到<>403个错误(如不开放流:吉大港群岛大学请求失败!) HTTP/1.0 403 Forbidden)。

<?php
$url="https://www.googleapis.com/drive/v1/files/".$_GET["id"]."";
$json = file_get_contents($url);
$data= json_decode($json,true);
print_r($data);
?>

Do I need to check again that the user is logged in? If so, which is the quicker way?

问题回答

如果档案不公开(仅向特定用户共享),则请求必须包含授权负责人(具体来说是1名OAuth 2.0负责人)。

我建议查看。 PHP DrEdit 样本代码,使你能够熟悉“快车”网络、Picker API和授权机制。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签