师阳 2015-07-20 10:55:03 13985次浏览 13条评论 12 10 0

yii2-qiniu https://github.com/crazyfd/yii2-qiniu

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": {
    "crazyfd/yii2-qiniu": "dev-master"
  }
}
php composer.phar update

Usage

<?php 
use crazyfd\qiniu\Qiniu;
$qiniu = new Qiniu($ak, $sk,$domain, $bucket);
$key = time();
$qiniu->uploadFile($_FILES['tmp_name'],$key);
$url = $qiniu->getLink($key);
觉得很赞
亿速云
您需要登录后才可以评论。登录 | 立即注册