library fileserve
Coercive FileServe Utility
coercive/fileserve
Coercive FileServe Utility
- Wednesday, February 7, 2018
- by Coercive
- Repository
- 1 Watchers
- 2 Stars
- 673 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 16 % Grown
Coercive FileServe Utility
PHP Serve File with header., (*1)
Get
composer require coercive/fileserve
Usage
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();
Options, (*2)
# 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()