Ticket File Attachments with Spaces

I have developed a FreshDesk app that uses the axios library to download ticket file attachments as a arrayBuffer and then sends the base64 encoded output to an external host. To download the file I must use the attachment_url obtained from the ticket data object.

This method works great for attachment files without special characters. However I just performed a test with a file attachment with spaces and the axios request failed with access denied. It looks like the spaces in the file name in the URL are encoded with ‘+’ instead of ‘%20’. In fact, if I copy the URL from the log and attempt to access the file using curl with the ‘+’ replaced with ‘%20’ then the request succeeds.

I’m sure others have encountered this problem previously but I was unable to find a solution amongst the topics. What’s the preferred method for resolving this problem?

For those encountering this thread. Replacing the ‘+’ with ‘%20’ seems to have fixed the problem. I performed some additional tests with files containing special characters and it seems like they are encoded properly. I will update the thread if I encounter additional problematic filenames.