Skip to main content
16-Pearl
October 24, 2025
Question

FileRepositoryDownloader returns 406 error when file name contains # character -even when URL encode

  • October 24, 2025
  • 1 reply
  • 667 views

Hi everyone,

I’m running into an issue with ThingWorx FileRepositoryDownloader when trying to download files that contain a # character in their name.

For example, I have a file in my repository called:

 

test#2.pdf

 

 

When I build the URL dynamically using encodeURIComponent, it looks like this:

 

 
https://<server>/Thingworx/FileRepositoryDownloader?download-repository=test.FileRepository&directRender=true&download-path=%2F1760338581178%2F1761219448752%2Ftest%232.pdf

 

 

However, the request always fails with:

 

 
HTTP 406Not Acceptable

 

and the response shows Content-Length: 0 from the ThingWorx Nginx server.

If I rename the file (for example to test_2.pdf), the same request works perfectly.

It seems that even though the filename is correctly encoded (%23), the FileRepositoryDownloader servlet doesn’t handle # correctly inside the download-path query string.

Has anyone else encountered this before?

 

i am using webgl widget to render pdf in browser..

 

 output = "/Thingworx/FileRepositoryDownloader?download-repository=" + fileRepository + "&directRender=true&download-path=" + encodeURIComponent(path);


Is there a known workaround or a configuration change to make ThingWorx accept such filenames (without renaming them)?

 

Note All German characters in pdf name were causing an issue but after adding this encodeURIComponent(path) in generating pdf path all problems were resolved. special characters mean ü ö but this only file which has # hash sign is causing an issue. 

 

Any help or confirmation would be greatly appreciated 

1 reply

Rocko
19-Tanzanite
October 24, 2025

Two ideas:

1) You could try the alternative link to download, without the FileRepositoryDownloader.

<Thingworx>/FileRepositories/myRepository/myFile.txt
2) Check TWX and Tomcat log. There might be more information,  HTTP 406Not Acceptable  
sounds a bit like the character was forbidden - there is a config about allowed characters, maybe you run into this.
I think it's in esapi/validation.properties
 
MA873117416-PearlAuthor
16-Pearl
October 24, 2025

Thanks @Rocko  are you talking about platform-settings.json file? Or how can i find this configs where these all validation properties are mentioned? 

Rocko
19-Tanzanite
October 24, 2025

no, esapi is a subdirectory in your TWX ThingworxStorage directory. There might be also something in the help about this. If this is the issue, you have to add # as an allowed character into the regular expression.