PHP code example of blackcube / fileprovider
1. Go to this page and download the library: Download blackcube/fileprovider 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/ */
blackcube / fileprovider example snippets
use Blackcube\FileProvider\FileProvider;
use Blackcube\FileProvider\Flysystem\FlysystemLocal;
use Yiisoft\Aliases\Aliases;
$provider = new FileProvider(new Aliases());
$provider->addFilesystem('@bltmp', new FlysystemLocal('/tmp/uploads'));
$provider->addFilesystem('@blfs', new FlysystemLocal('/var/www/storage'));
// Write, move, read
$provider->write('@bltmp/upload.jpg', $content);
$provider->move('@bltmp/upload.jpg', '@blfs/images/photo.jpg');
$content = $provider->read('@blfs/images/photo.jpg');
// Image processing (