sharapeco / file-download
Make downloads for files in PHP
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/sharapeco/file-download
Requires
- php: ^5.4.0 || ^7.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-09-17 14:42:02 UTC
README
- Make downloads from file
- Make downloads from content
- IE 9+ (ja), Safari 5+ (ja), Android 4.4+, Chrome, Firefox, Edge support
Usage
From file
$filePath = '/path/to/file'; $download = sharapeco\HTTP\FileDownload::initWithFile($filePath); $download->download('download-filename');
From content
$content = 'This is the content of the file'; $download = sharapeco\HTTP\FileDownload::initWithContent($content); $download->download('download-filename');
Show PDF in browser with filename
$filePath = '/path/to/pdf'; $download = sharapeco\HTTP\FileDownload::initWithFile($filePath); $download->showPDF('filename.pdf');