PHP code example of pdsinterop / flysystem-nextcloud

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

    

pdsinterop / flysystem-nextcloud example snippets



/** @var IRootFolder $rootFolder */
$folder = $rootFolder->getUserFolder('userId')->get('/some/directory');

// Create the Nextcloud Adapter
$adapter = new \Pdsinterop\Flysystem\Adapter\Nextcloud($folder);

// Create Flysystem as usual, adding the Adapter
$filesystem = new \League\Flysystem\Filesystem($adapter);

// Read the contents of a file
$content = $filesystem->read('/some.file');