crazyfd/yii2-qiniu

yii2上传到七牛云存储

Installs: 9 793

Dependents: 1

Suggesters: 0

Security: 0

Stars: 40

Watchers: 6

Forks: 18

Open Issues: 3

Type:yii2-extension

1.03 2018-01-03 03:28 UTC

This package is not auto-updated.

Last update: 2024-12-12 07:11:59 UTC


README

file upload for qiniu

最近会调整版本

{
  "require": {
    "crazyfd/yii2-qiniu": "*"
  }
}
composer install

Usage

<?php
$ak = 'sss';
$sk = 'sss';
$domain = 'http://demo.domain.com/';
$bucket = 'demo';
$zone = 'south_china';
use crazyfd\qiniu\Qiniu;
$qiniu = new Qiniu($ak, $sk,$domain, $bucket,$zone);
$key = time();
$key .= strtolower(strrchr($_FILES['name'], '.'));

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