da-vinci-studio / file-bundle
File Bundle
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- da-vinci-studio/path-generator: ~0.1.0
- da-vinci-studio/uuid-generator: ~0.1.0
- league/flysystem: ~1.0
- oneup/flysystem-bundle: ^1.4
Requires (Dev)
- phpspec/phpspec: ^2.5
This package is not auto-updated.
Last update: 2024-11-21 03:50:26 UTC
README
###Installation
- Add bundle into composer.json
composer require da-vinci-studio/file-bundle
-
Register bundle in AppKernel
public function registerBundles() { $bundles = [ // ... new \Dvs\FileBundle\DvsFileBundle() ]; }
###Using FileReceiver FileReceiver provides a way to save files in a specific localization via FlySystem. It will take care of your file's name and path generation needed for correct saving.
- Create a directory for file saving (e.g. document in root_dir)
- Register directory in parameters.yml
document_upload_dir: document
-
According to FlySystem documentation register file system in config.yml in connection with created directory
dvs_file: filesystems: pp_standard: adapter: local: directory: "%kernel.root_dir%/document"
-
Register FileReceiver as a dependency using id: dvs.file_receiver