title: How to configure OneUpUploaderBundle and OneUpFlysystemBundle to work in Symfony 4.1
body: <h2>Introduction</h2>
  
  <p>I am trying out <code>Syfony 4.1</code> with <code>OneUpUploaderBundle</code> and <code>OneUpFlysystemBundle</code>.</p>
  
  <h2>Problem</h2>
  
  <p>My configuraton worked fine in <code>Symfony 3.4</code> yet with <code>Symfony 4.1</code> 
  i can not figure out how to inject OnUpUploaderBundle in my code in controler.</p>
  
  <h2>Configuration</h2>
  
  <p><strong>OneUpUploader.yaml</strong></p>
  
  <pre><code>oneup_uploader:
      mappings:
          gallery:
              storage:
                  type: flysystem
                  filesystem: oneup_flysystem.gallery_filesystem
  
              frontend: blueimp
              enable_progress: true
              namer: app.upload_unique_namer
  
              max_size: 104857600
  </code></pre>
  
  <p><strong>OneUpFlysystem.yaml</strong></p>
  
  <pre><code>oneup_flysystem:
      adapters:
          my_adapter:
              local:
                  directory: '%kernel.root_dir%/../data'
  
      filesystems:
          default_filesystem:
              adapter: my_adapter
              alias: League\Flysystem\Filesystem
  </code></pre>
  
  <p><strong>Part of services.yaml</strong></p>
  
  <pre><code>app.upload_listener:
      class: App\EventListener\UploadListener
      arguments: ['@doctrine.orm.entity_manager', '@session', '@service_container']
      tags:
          - { name: kernel.event_listener, event: oneup_uploader.pre_upload.gallery, method: onUpload }
          - { name: kernel.event_listener, event: oneup_uploader.post_upload.gallery, method: onPostUpload }
  
  app.allowed_mime_type_listener:
      class: App\EventListener\AllowedMimeTypeValidationListener
      arguments: ['@service_container']
      tags:
          - { name: kernel.event_listener, event: oneup_uploader.validation.gallery, method: onValidate }
  
  app.upload_unique_namer:
      class: App\Uploader\Naming\UploadUniqueNamer
      arguments: ['@service_container']
      public: true
  
  // SEE sections ERROR 1 and ERROR 2
  // FOR relevant config details
  oneup_flysystem.gallery_filesystem:
      class: [...]
      public: true
  </code></pre>
  
  <h2>Code</h2>
  
  <pre><code>// previously, to reference upoad root path node
  // i could just write following in controller and it worked
  
  $filesystem = $this-&gt;get('oneup_flysystem.gallery_filesystem');
  
  $complete_file_path = $ultraHelpers-&gt;getDownloadableFilePath($file_id);
  $exists = $filesystem-&gt;has($complete_file_path);
  
  // Now i am stumped how to get the same effect in symfony 4.1
  </code></pre>
  
  <h2>Error 1</h2>
  
  <p>if modified my service like so</p>
  
  <pre><code>oneup_flysystem.gallery_filesystem:
      class: League\Flysystem\FilesystemInterface
      public: true
  </code></pre>
  
  <p>current error</p>
  
  <blockquote>
    <p>Cannot instantiate interface League\Flysystem\FilesystemInterface</p>
  </blockquote>
  
  <h2>Error 2</h2>
  
  <p>if modified my service like so</p>
  
  <pre><code>oneup_flysystem.gallery_filesystem:
      class: League\Flysystem\Filesystem
      public: true
  </code></pre>
  
  <p>current error</p>
  
  <blockquote>
    <p>(1/1) RuntimeException
    Cannot autowire service "oneup_flysystem.gallery_filesystem": argument "$adapter" of method "League\Flysystem\Filesystem::__construct()" references interface "League\Flysystem\AdapterInterface" but no such service exists. You should maybe alias this interface to the existing "oneup_flysystem.my_adapter_adapter" service.</p>
  </blockquote>