Download the PHP package igorw/file-serve-bundle without Composer
On this page you can find all versions of the php package igorw/file-serve-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download igorw/file-serve-bundle
More information about igorw/file-serve-bundle
Files in igorw/file-serve-bundle
Package file-serve-bundle
Short Description Symfony2 Bundle for serving protected files.
License MIT
Informations about the package file-serve-bundle
FileServeBundle
About
The FileServeBundle allows you to serve files that are not publicly available, such as private attachments.
Installation
Add the bundle to your composer.json
:
Add the FileServeBundle to your application's kernel:
Usage
Use the igorw_file_serve.response_factory
service to create a FileServe
response. The path is relative to the app
directory by default.
You can also pass a set of options as the third parameter of the create
method.
- serve_filename: Filename the browser downloads the file as.
- absolute_path: If enabled, the bundle will ignore the
base_dir
option and use the provided filename as an absolute path.
You can configure the factory used, for example to use a nginx XSendfile response factory:
You can also configure the base directory:
By default, this bundle does a file_exists
check when creating a response
object. Recent nginx versions require relative paths, in which case the paths
inside of PHP are not actual physical paths. Use the skip_file_exists
setting to disable the check.
Supported factories
php
sendfile
(nginx)xsendfile
(apache)
Features
- Incremental serving of large files
- Nginx XSendfile
- Apache mod_xsendfile
Todo
- Tests
- HTTP caching
- HTTP range requests
- Lighttpd XSendfile
- Handle PhpResponse getContent(), setContent()