flyok666/yii2-qiniu

yii2上传到七牛云存储

This package's canonical repository appears to be gone and the package has been frozen as a result.

Installs: 315

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.2 2017-07-18 14:48 UTC

This package is not auto-updated.

Last update: 2019-05-26 00:56:28 UTC


README

composer.json:

{
  "require": {
    "flyok666/yii2-qiniu": "~1.0.0"
  }
}

Usage

<?php

use flyok666\qiniu\Qiniu;
$config = [
'accessKey'=>'xxx',
'secretKey'=>'xxx',
'domain'=>'http://demo.domain.com/',
'bucket'=>'demo',
'area'=>Qiniu::AREA_HUABEI
];



$qiniu = new Qiniu($config);
$key = time();
$qiniu->uploadFile($_FILES['tmp_name'],$key);
$url = $qiniu->getLink($key);