Download the PHP package mostafaznv/php-x-sendfile without Composer
On this page you can find all versions of the php package mostafaznv/php-x-sendfile. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mostafaznv/php-x-sendfile
More information about mostafaznv/php-x-sendfile
Files in mostafaznv/php-x-sendfile
Package php-x-sendfile
Short Description Serve large files using web server with support for laravel
License MIT
Informations about the package php-x-sendfile
PHP X-Sendfile
Serve large files using web server with support for laravel
Some features for X-Sendfile:
- Support Nginx, Apache, LiteSpeed, Lighttpd
- Automatic Server Type Detector
- Configurable
- Support Cache
- Set Extra Headers
- Compatible with Laravel
I develop in a open-source journey 🚀, I wish I lived in an environment where financial situation was fine and I could only focus on the path, but as you may know, life isn't perfect.
So if you end up using my packages, please consider making a donation, any amount would go along way and is much appreciated. 🍺
Requirements:
- PHP >=7.0.1
- FileInfo Extension
Installation
Install using composer:
Laravel (Optional)
-
Register Provider and Facade in config/app.php:
Don't need for Laravel 5.5+
-
Publish config file:
Usage
Laravel Usage
Note: to change configuration in laravel, open config/x-sendfile.php and set your own configurations.
Config:
Key | Default | Type | Description |
---|---|---|---|
server | null | string | with null value, package will detect server type automatically supported: Nginx, Apache, LiteSpeed, Lighttpd |
base-path | $_SERVER['DOCUMENT_ROOT'] | string | defines base path of your project. |
cache | true | boolean | enable/disable for caching response |
cache-control-max-age | 2592000 | integer | set maximum age of cache |
Methods
Download
Argument Index | Argument Name | Default | Type | Description |
---|---|---|---|---|
0 | file | string | relative (related to project index.php file) or absolute file path | |
1 | fileName | null | string | user defined file name |
setHeader
Argument Index | Argument Name | Default | Example | Type | Description |
---|---|---|---|---|---|
0 | headers | ['Header-Name' => 'Header-Value')] | array | Key-Value array. key is header name value is header value |
I develop in a open-source journey 🚀, I wish I lived in an environment where financial situation was fine and I could only focus on the path, but as you may know, life isn't perfect.
So if you end up using my packages, please consider making a donation, any amount would go along way and is much appreciated. 🍺
Credit and Thanks
this package inspired by songlipeng2003's x-sendfile.
Changelog
Refer to the Changelog for a full history of the project.
License
This software released under Apache License Version 2.0.
(c) 2020 Mostafaznv, All rights reserved.
Sponsors
All versions of php-x-sendfile with dependencies
ext-fileinfo Version *