尝试使用php将图像文件上传到Google驱动器时出现错误。
我正在按照以下过程https://github.com/spjoshis/File-Uploader-To-Google-Drive-PHP
我还在Google开发人员控制台上为Google Drive API创建了oauth凭据,然后按照链接https://github.com/spjoshis/File-Uploader-To-Google-Drive-PHP
的说明下载了JSON FILE以下是我的索引文件
<?php
include 'upload.php';
$drive = new GoogleDrive();
$file = $drive->upload('files/', 'android.png');
if (!empty($file->id)) {
printf("File Uploaded Successfully! [ID: %s\n", $file->id.']');
}
?>`
我收到致命错误:
未捕获的InvalidArgumentException:/var/www/html/drive/vendor/google/apiclient/src/Google/Client.php:839中不存在文件:堆栈跟踪:#0 / var / www / html / drive / upload .php(26):Google_Client-> setAuthConfig('/ var / www / html / d ...')#1 / var / www / html / drive / upload.php(77):GoogleDrive-> getClient()# 2 /var/www/html/drive/index.php(8):GoogleDrive-> upload('files /','android.png')#3 {main}放在/ var / www / html / drive / vendor中/google/apiclient/src/Google/Client.php,第839行