File name with special characters like "[]"

Hi,

I have uploaded images in the file section whose file name contains square brackets ("[]"). So for example: myImage[message].svg
When opening the path to that file I get the following error:

Illegal request-target: Invalid input '[', expected pchar, '/', '?' or 'EOI'

(even though the URL is encoded)
I have found resources about escaping [ inside of where clauses and such but nothing for URLs.
Unfortunately, it is required for me to have [] in there.

Is there any way to access files with [] in the name?
Thank you very much in advance.

Hi @app.monster,

can you please provide a sample URL with such a file?
I have tried to upload an image with square brackets in the name (test[image].jpeg), and I can successfully open it by its URL:

https://backendlessappcontent.com/F351D657-23B3-D14F-FF45-9DCB5345CE00/8BB5DEC6-BC50-61E3-FF3D-11C5B37B8800/files/test%5Bimage%5D.jpeg
As you can see, the opening bracket becomes %5B, and the closing - %5D.

Regards,
Stanislaw

Hi Stanislaw,
thank you for the quick response. I didn’t realize that this was the URL structure. With this it works, thank you!
I tried using the path that is returned in the REST console, so for example: https://subdomain.backendless.app/api/files/templates/thumb[icon].svg
(throws error despite encoding) and here without :
https://subdomain.backendless.app/api/files/templates/thumb+icon.svg

But I can make it work with the backendlessappcontent.com domain :slight_smile:

Yes, for some reason using the custom domain does not process the file name correctly.
I’ve created an internal ticket in order to fix this (BKNDLSS-27820).

Regards,
Stanislaw

1 Like

Hi Stanislaw,

are there any updates on the ticket?
Thanks!

Hi @app.monster,

the work in progress. We’ll let you know here once we have any progress with it. Thank you for your patience!

Regards,
Stanislaw

1 Like

Hello @app.monster

We apologise for the long wait. We have just updated the cloud servers with a fix for the problem you described above. Could you please let us know if the fix works for you?

Regards,
Inna

Hi Inna,

thank you very much, it works!