public function actionTest()
{
$file = '/path/a.jpg';
$response = Yii::$app->response;
$response->headers->set('Content-type', \yii\helpers\FileHelper::getMinmeType($file));
$response->format = \yii\web\Response::FORMAT_RAW;
$response->stream = fopen($file, 'r');
return $response;
}
Yii2 返回图片音视频数据流
2021年07月01日 129阅读 0 字 0 条评论
版权属于:颖小主
本文链接:https://main.itffz.cn/archives/31.html
所有笔记内容均来自本人学习整理摘要,著作权归作者所有。商业转载请联系作者获得授权,非商业转载请保留作者信息和原文链接。