May 18, 2022
2
Level 5
Google drive upload file
Greeting everyone iam trying to upload a file to google drive :
- i activate google drive on my api
- i got my refresh token
- i install nao-pon/flysystem-google-drive:~1.1
- i added my cred in env config/filesystem.php
return [
// ...
'cloud' => 'google', // Optional: set Google Drive as default cloud storage
'disks' => [
// ...
'google' => [
'driver' => 'google',
'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'),
'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'),
'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'),
'folderId' => env('GOOGLE_DRIVE_FOLDER_ID'),
],
// ...
],
// ...
];
.env
GOOGLE_DRIVE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_DRIVE_CLIENT_SECRET=xxx
GOOGLE_DRIVE_REFRESH_TOKEN=xxx
GOOGLE_DRIVE_FOLDER_ID=xxx
and i got that i am not login in
{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }
Please or to participate in this conversation.