PHP code example of marktaborosi / flysystem-nextcloud

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

    

marktaborosi / flysystem-nextcloud example snippets


use League\Flysystem\Filesystem;
use Marktaborosi\FlysystemNextcloud\NextCloudAdapter;

$adapter = new NextCloudAdapter([
    'baseUri' => 'http://localhost:8080/remote.php/dav/files/admin/',
    'userName' => 'admin',
    'password' => 'admin',
]);

$filesystem = new Filesystem($adapter);

$filesystem->write('example.txt', 'Hello Nextcloud!');