Trying to get it working on Symfony 5.3.1 #406
Replies: 1 comment
-
Name Method Scheme Host Path _preview_error ANY ANY ANY /_error/{code}.{_format} So the route configured for oneuploader was /_uploader/gallery/upload I changed the form action in the HTML file to point to the route
Changed the allow Orgin parameter in config/packages/nalimo_cors.yaml The error remains. Working to resolve it |
Beta Was this translation helpful? Give feedback.
-
I am trying to get this to work on Symfony 5.3.1 installed on local host as follows.
(documenting the sequence of steps so that its helpful to others)
Created a new synfony project
$ symfony new <project name>
Installed the oneup bundle using composer
$ composer require oneup/uploader-bundle
As per the Step 2 in accompanying Index.md the bundle has to enabled in the kernel. But then in symfony 5.x it has to be done in the config/bundles.php. It is automatically enabled and the following entry was present
Oneup\UploaderBundle\OneupUploaderBundle::class => ['all' => true],
As per the Step 3 in accompanying Index.md the bundle has to be configured. However the configuration is automatically done when the bundle is installed. I see that there are two files config/packages/oneup_uploader.yaml and config/routes/oneup_uploader.yaml
The packages/oneup_uploader.yaml contains
The config/routes/oneup_uploader.yaml contains
I connected the form action to the dynamic route that is mentioned in the config/packages/oneup_uploader.yaml . See the step 4 above.
When I load the URL and in the browser and try to upload an image I get a 404 error.
I then did an inspect element in the browser and I see the following error
Access to XMLHttpRequest at 'https://app-directory.s3.amazonaws.com/hootlet/launched-app-directory-apps.json' from origin 'http://anybank.co.in' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
location ~* .(png|jpg)$ {
add_header Access-Control-Allow-Origin *;
}
However I continue to get the same error. Is there anything that I can do to get this working?
EDIT :
6. I updated the nginx congiguration as follows (had forgotton the simgle quotes'
I now get the followwg error
dropzone.js:2735 POST http://anybank.co.in/_uploader_gallery 404 (Not Found)
This means that the route configuration is incorrect. Can someone tell what could be wrong?
Beta Was this translation helpful? Give feedback.
All reactions