coercive / fileserve
Coercive FileServe Utility
Installs: 1 365
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=7
- ralouphie/mimey: ^2.1
README
PHP Serve File with header.
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
# 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()