mhndev/slim-file-response
最新稳定版本:0.1.1
Composer 安装命令:
composer require mhndev/slim-file-response
包简介
Slim File Response
README 文档
README
using this package you can simply make http file response. so what FileResponse class does is, set needed http headers for file response and also getResponse method has an optional third parameter which you can provide when you want http client save file as a name other than the name which stored on server.
Sample usage
$app->get('/test/image',function($request, $response){ $filePath = '/path/to/your/image/file'; return mhndev\slimFileResponse\FileResponse::getResponse($response, $filePath); }); $app->get('/test/pdf',function($request, $response){ $filePath = '/path/to/your/pdf/file'; return mhndev\slimFileResponse\FileResponse::getResponse($response, $filePath ,'myDocument'); });
统计信息
- 总下载量: 2.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-23