2

I am trying to config the OneupUploaderBundle. According to the documentations in github, the given config is:

oneup_uploader:
    mappings:
        gallery:
            frontend: blueimp # or any uploader you use in the frontend

For this config, I got this error:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "_uploader_upload_gallery" as such route does not exist.") in "MinnAdsBundle:Motors:oneup.html.twig" at line 25.

I tried to solve this issue by adding this config (as mentionned in github) to become like this:

oneup_uploader:
    mappings:
        gallery:
            frontend: blueimp # or any uploader you use in the frontend  
    resource: .
    type: uploader 

The obtaind error is:

InvalidConfigurationException: Unrecognized options "resource, type" under "oneup_uploader"

So, I am wondering what I have missed in the config of this bundle.

For your information, The version I installed in my symfony project is:

"oneup/uploader-bundle": "1.3.1"

Thank for your help.

devsheeep
  • 2,076
  • 1
  • 22
  • 31
Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73

1 Answers1

2

The documentation states the following:

To enable the dynamic routes, add the following to your routing configuration file.

#  app/config/routing.yml

oneup_uploader:
    resource: .
    type: uploader

The correct place to put this is not the config.yml file but the routing.yml file instead.

devsheeep
  • 2,076
  • 1
  • 22
  • 31
  • Can you tell me what the "enable dynamic routes" option does exactly? – Etienne Noël Feb 16 '15 at 13:58
  • 1
    Sure. Basically it registers a route `/_upload/{mapping}` foreach configured mapping in the router which will be accountable for the file uploads to this mapping. This is not an optional step to do. – devsheeep Feb 16 '15 at 15:38
  • So basically this would be the url you send the uploaded file to ? or am I missing something – Etienne Noël Feb 16 '15 at 16:54
  • This is correct, yes. Take a look at the implementation of the [`RouteLoader`](https://github.com/1up-lab/OneupUploaderBundle/blob/master/Routing/RouteLoader.php#L32-L53). – devsheeep Feb 16 '15 at 17:02