PHP code example of alphasnow / aliyun-oss-thinkphp
1. Go to this page and download the library: Download alphasnow/aliyun-oss-thinkphp 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/ */
alphasnow / aliyun-oss-thinkphp example snippets
use think\facade\Filesystem;
$file = request()->file('image');
$savename = Filesystem::disk('aliyun')->putFile( 'image', $file);
use think\facade\Filesystem;
$filesystem = Filesystem::disk('aliyun');
$filesystem->write('prefix/path/file.txt',file_get_contents('/local/path/file.txt'));