PHP code example of anan / oss

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

    

anan / oss example snippets

t
    
    use Anan\Oss\Facades\EasyOss;
    // 随机生成文件名
    $ossUrl = EasyOss::uploadFile('/tmp/logo.jpg');
    
    // 指定文件夹名称,文件名随机生成
    $ossUrl = EasyOss::uploadFile('/tmp/logo.jpg', 'store');
    
    // 指定文件名
    $ossUrl = EasyOss::uploadFile('/tmp/logo.jpg', 'new-logo.jpg');
    
    // 指定完整文件名
    $ossUrl = EasyOss::uploadFile('/tmp/logo.jpg', 'logo/new-logo.jpg');