PHP code example of vvk / upyun-filesystem
1. Go to this page and download the library: Download vvk/upyun-filesystem 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/ */
vvk / upyun-filesystem example snippets
'disks' => [
...
'upyun' => [
'driver' => 'upyun',
'service' => env('UPYUN_SERVICE', ''),
'operator' => env('UPYUN_OPERATOR', ''),
'password' => env('UPYUN_PASSWORD', ''),
'domain' => env('UPYUN_DOMAIND', ''),
],
],
Storage::disk('upyun')->has('a.png');
Storage::disk('upyun')->get('a.png');
Storage::disk('upyun')->write('a.png', file_get_contents('a.png'));
Storage::disk('upyun')->writeStream('a.png', fopen('path/a.png', 'r'));
Storage::disk('upyun')->update('a.png', file_get_contents('a.png'));
Storage::disk('upyun')->updateStram('a.png', file_get_contents('a.png'));
Storage::disk('upyun')->rename('old.png', 'new.png');
Storage::disk('upyun')->copy('a.png', 'new.png');
Storage::disk('upyun')->delete('a.png');
Storage::disk('upyun')->deleteDir('/a');//非空目录不能删除
Storage::disk('upyun')->createDir('/a/b/c');
Storage::disk('upyun')->read('a.png');
Storage::disk('upyun')->readStream('a.png');
Storage::disk('upyun')->listContents('/');
Storage::disk('upyun')->getUrl('/a.png');
Storage::disk('upyun')->getType('/a.png');
Storage::disk('upyun')->getMetadata('/a.png');
Storage::disk('upyun')->getSize('/a.png');
Storage::disk('upyun')->getMimetype('/a.png');
Storage::disk('upyun')->getTimestamp('/a.png');