Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

多媒体管理

张铭阳 edited this page Oct 1, 2017 · 1 revision

上传媒体文件

API

// 上传图片
array uploadImage(string $path)
// 上传语音
array uploadVoice(string $path)
// 上传普通文件
array uploadFile(string $path)

Example

$app->media->uploadImage('/path/to/image.png');

上传媒体文件

API

Psr\Http\Message\StreamInterface download(string $mediaId)

Example

$stream = $app->media->download('media-id');
file_put_contents('here.png', $stream);
Clone this wiki locally