2017 © Pedro Peláez
 

symfony-bundle file-bundle

File Bundle

image

da-vinci-studio/file-bundle

File Bundle

  • Tuesday, July 26, 2016
  • by itcraftsmanpl
  • Repository
  • 3 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

file-bundle

Installation

  1. Add bundle into composer.json, (*1)

    composer require da-vinci-studio/file-bundle, (*2)

  2. Register bundle in AppKernel, (*3)

     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., (*4)

  1. Create a directory for file saving (e.g. document in root_dir)
  2. Register directory in parameters.yml, (*5)

    document_upload_dir: document, (*6)

  3. According to FlySystem documentation register file system in config.yml in connection with created directory, (*7)

     dvs_file:
       filesystems:
         pp_standard:
           adapter:
             local:
               directory: "%kernel.root_dir%/document"
  4. Register FileReceiver as a dependency using id: dvs.file_receiver, (*8)

The Versions