我跟随使用php直接从远程服务器上传一个文件到Google上:因此我从Google控制台创建了新的API,启用了Drive和Drive服务,请求OAuth客户端ID和客户端秘密,并将它们写入脚本,然后将它们与文件夹一起上传到,以检索Auth代码:
<?php
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_DriveService.php';
$drive = new Go
我正在使用后台运行的php代码将一个文件从Google存储桶上传到Google文件夹。我的问题是当文件的大小增加时,Google (或GAE)会给出一个500错误。
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
我使用下面的依赖项。
“nao/flysystem-google-驱动器”:"^1.1",
下面是给出此错误的代码部分。对于小型文件来说,这是非常有效的:
$fileN =
我已经使用下面的代码在google驱动器上添加了一个新文件。
<?php
// inclusione delle librerie del client
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_DriveService.php';
// istanza dell'oggetto di classe relativo al client
$drive = ne
当我从php运行API时,返回的唯一项是"How to get started with Drive“文件,它不在文件夹中,但当我从API网页运行retrieveListOfAllFiles()时,我看到了驱动器中的所有文件。下面是代码。
set_include_path(ABSPATH . "path-to/api/google-api-php-client/src/");
require_once "Google/Client.php";
require_once "Google/Service/Drive.php";
require
我所需要的只是删除一个文件,它在我的共享驱动器文件夹中使用google/apiclient使用php,这是我下面的代码。
session_start();
require __DIR__ . '/vendor/autoload.php'; // ready the API to upload to drive
use Google\Client;
use Google\Service\Drive;
if (isset($_POST['file'])) {
$file = $_POST['file'];
$clien
我从那里创建了新的模块"googleapi.module“,我试图加载google api库来在google drive中创建一些文件,但我收到了一个错误:
消息: /home/main/public_html/backoffice/sites/all/modules/main/googleapi/library/google-api-php-client-2.2.0/src/Google/Client.php不存在受保护的=>文件
我认为这与drupal路径有关,因为我有一个简单的index.php文件,可以完美地工作并加载库……
以下是drupal代码:
function g