hongyukeji/yii2-qiniu
yii2上传到七牛云存储
Installs: 27
Dependents: 0
Suggesters: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
README
- @author Shadow admin@hongyuvip.com
- @version 1.1
file upload for Yii Framework 2
php > 5.5
How to install? To use this extension, you may insert the following code:
Get it via composer by adding the package to your composer.json
:
{ "require": { "hongyukeji/yii2-qiniu": "dev-master" } }
php composer.phar update
Usage
<?php $ak = 'sss'; $sk = 'sss'; $domain = 'http://demo.domain.com/'; $bucket = 'demo'; use hongyukeji\qiniu\Qiniu; $qiniu = new Qiniu($ak, $sk,$domain, $bucket); $key = time(); $qiniu->uploadFile($_FILES['tmp_name'],$key); $url = $qiniu->getLink($key);