Yii2 阿里云 OSS 安装 1 composer require mrk/yii2-aliyun-oss:@dev or add 1 "mrk/yii2-aliyun-oss":"@dev" 使用 在 main.php 文件中做如下修改 123456789 components => [ 'oss' => [ 'class' => 'mrkaliyunOSS', 'accessKeyId' => 'xxxxx', 'accessKeySecret' => 'xxxx', // 阿里云 AccessKeySecret 'bucket' => 'xxx', // bucket 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com', //OSS节点地址 ],] 在 controller 中 1 Yii::$app->oss->upload($object,$file); 赞微海报分享
近期评论