Symfony Oneup_uploader bundle, problem wenth generating url in response: \/ separator instead of /

75 views Asked by At

I've followed the documentation of the symfony's bundle oneup_uploader for uploading file to a specific endpoint.

It work well, but when i try to send a response on my listener, like an url and when i try to add field 'url' in my response, it return me an url like that: url/someurl instead of url/someurl. Instead of / i got \ / , but if i dump this, i got the right url with \ / instead of this /. It only happen in the return of the response array..

If i just dump that the link work fine.

It's because i'm returning a plain text instead of a json, but i don't understand why i'm returning a plain text instead of json. How can i configure oneup_uploader to return a json response instead of a plain text ?

2

There are 2 answers

0
Eric On BEST ANSWER

I added header parameter "Accept : application/json" and works perfectly

0
Eric On

Ok i got my answer, that can be a little problem with the bundle. I was testing with an HTTP client for testing my api, so everytime it returned me a plain/text.

But like i did for my configuration, if i call my api from my front, this time i used dropzone, it works fine, because i configured a front for dropzone.

Maybe there's a solution, it's configuring many front and more specifically one for a HTTP client.