PHP code example of byrnes2014 / flysystem-oss

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

    

byrnes2014 / flysystem-oss example snippets


    use Byrnes2014\Flysystem\Oss\QssAdapter;


 $flysystem->write('file.md', 'contents');

 $flysystem->write('file.md', 'http://httpbin.org/robots.txt', ['mime' => 'application/redirect302']);
 
 $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));

 $flysystem->update('file.md', 'new contents');

 $flysystem->updateStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));

 $flysystem->rename('foo.md', 'bar.md');

 $flysystem->copy('foo.md', 'foo2.md');

 $flysystem->delete('file.md');

 $flysystem->has('file.md');

string|false $flysystem->read('file.md');

array $flysystem->listContents();

array $flysystem->getMetadata('file.md');

int $flysystem->getSize('file.md');

string $flysystem->getAdapter()->getUrl('file.md'); 

string $flysystem->getMimetype('file.md');

int $flysystem->getTimestamp('file.md');