upyun

the extensions of upyun for yii
2 followers

This ext for upyun.Upyun is a distributed image processing.I deal it for yii.

Requirements

No limit

Installing and configuring

  1. Download and extract to extension folder.
  2. install this extension in config/main.php

Basic Set

......
'file'=>array(
    'class'=>'application.extensions.upyun.FileUpload',                   
    'bucketname'=>'',
    'username'=>'',
    'password'=>'',
),
.......

Advance Set

...............
'file'=>array(  
'class'=>'application.extensions.upyun.FileUpload',                         
'bucketname'=>'',
'username'=>'',
'password'=>'',
'opts'=>array(
    'X_GMKERL_TYPE' => 'square', // type for the thumb
    'X_GMKERL_VALUE'=> 100, // size for the thumb
    'X_GMKERL_QUALITY' => 95, // quality for the thumb
    'X_GMKERL_UNSHARP' => True //whether to Sharpening
)
................

Usage

$fileContent = file_ge_contents($file);
$pic = Yii::app()->file->uploadFileByContent($fileContent,$newFilename,$newFileExt);
if(!isset($pic['error'])){
    $path = $pic['path'];
    $url = Yii::app()->file->getFileUrl($path,'!w588');
}else{
    //TODO
}

Resources

Total 2 comments

#13890 report it
Y.Fan at 2013/07/04 09:32am
@#13887

i think the upyun just for china first , i will translate the text into English recently.

#13887 report it
trond at 2013/07/04 08:55am
This web in English

So I suggest you translate the text into English for the benefit of users who are not fluent in Chinese...

Leave a comment

Please to leave your comment.

Create extension
Downloads