1. Go to this page and download the library: Download zlt/php-google-drive library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$service->put('This is example text', 'example.txt');
$service->put('This is text will be stored under specified dir','example.txt','12sdf_sdfjopwoeriupsdf')
$service->get('xxxxxxxxxxxxx');
// or
$service->get('xxxxxxxxxxxxx', [
// pass parameters
])
$service->getContent('xxxxxxxxxxxxx');
$service->makeDirectory('New Folder');
$service->makeDirectory('New Folder Under Specified Dir','12sdf_sdfjopwoeriupsdf')
// List files inside root dir.
$service->listContents()
// List files inside 'shared with me' folder.
$service->listContents(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
// List files inside root dir.
$service->directories()
// List files inside 'shared with me' folder.
$service->directories(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
// List files inside root dir.
$service->files()
// List files inside 'shared with me' folder.
$service->files(Zlt\PhpGoogleDrive\GoogleDriveService::SharedWithMe);
$service->delete('fileId')
bash
$ composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.