PHP code example of sumanpoudel / egnyte

1. Go to this page and download the library: Download sumanpoudel/egnyte 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/ */

    

sumanpoudel / egnyte example snippets

 php
$client = new \Suman\Egnyte\Model\File(EgnyteDomain, OAuthToken);

$adapter = new \Suman\Egnyte\EgnyteAdapter($client);

$filesystem = new Filesystem($adapter);

//to get the content of the file
$fileContents = $filesystem->get('/Shared/file.jpg');
//to check file exists
$fileContents = $filesystem->has('file.jpg');
//upload the file
$fileContents = $filesystem->put(fileLocation, contents_of_file);
//move the file 
$fileContents = $filesystem->move(originalLocation, newLocation);
//delete the file/folder
$fileContents = $filesystem->delete(location_of_file_or_folder);

// see the usrl below for more functions 
https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/