Skip to content

阿里云OSS上传建议封装,配合md52url使用。

Notifications You must be signed in to change notification settings

awheel/oss-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSS Upload

上传文件到阿里云 OSS 的封装, 文件格式使用 md52url 规范.

使用方法


composer require awheel/oss-upload

use awheel\OSSUpload\OSSUpload;

$bucket = '__BUCKET_NAME__';
$accessKeyId = '__ACCESS_KEY_ID__';
$accessKeySecret = '__ACCESS_KEY_SECRET__';
$endpoint = '__ENDPOINT__';
$pathPrefix = '/testupload';

$upload = new OSSUpload($bucket, $accessKeyId, $accessKeySecret, $endpoint, $pathPrefix);
$md5 = $upload->upload('./test.png');
$path = $upload->upload('./test.png', true);

echo $md5.PHP_EOL;
echo $path.PHP_EOL;

其中bucket,accessKeyId等需要替换为真实的配置信息,详见 example/upload.php

About

阿里云OSS上传建议封装,配合md52url使用。

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages