coercive / fileserve
Coercive 文件服务实用工具
2.0.5
2023-12-12 10:55 UTC
Requires
- php: >=7
- ralouphie/mimey: ^2.1
README
带有头部的PHP服务文件。
获取
composer require coercive/fileserve
使用方法
V1
use Coercive\Utility\FileServe; # Serve file FileServe::output('/path/file.extension');
V2
use Coercive\Utility\FileServe; # V2 $serve = new FileServe('/path/file.extension'); # Send range $serve->range(); # Serve file $serve->serve(); # Send download $serve->download(); # Get mime $string = $serve->mimeType(); # Get filesize $string = $serve->getSize();
选项
# Enable / Disable header no cache options $serve->enableCache() $serve->disableCache() # Enable / Disable header content disposition filename for html5 attr : <a download="filename"> $serve->enableFilename() $serve->disableFilename()