da-vinci-studio/file-bundle

There is no license information available for the latest version (v0.1.0) of this package.

File Bundle

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.1.0 2016-07-26 07:47 UTC

This package is not auto-updated.

Last update: 2024-12-19 04:08:12 UTC


README

###Installation

  1. Add bundle into composer.json

composer require da-vinci-studio/file-bundle

  1. 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.

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

document_upload_dir: document

  1. 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"
    
  2. Register FileReceiver as a dependency using id: dvs.file_receiver