Consistent rules for filenames in API and in Web GUI

When uploading a file via the GraphQL API, a filename must be specified via the filename=.... value under the Content-Disposition HTTP header. However, some characters are not allowed and are silently converted to an underscore or a space.
For instance if you use filename="M&A project.pdf" (or filename="M%26A project.pdf") it becomes M_A project.pdf when viewed in the Web UI. Contrast that with adding the same file via the web interface: The name is kept intact.
We have thousands of files from a legacy system that we want to store on Monday and automatic upload is therefore needed. That the existing way mangles the filenames is really annoying.
The request (which I consider more a bug report) is twofold:

  1. Document the naming rules in the GraphQL API documentation.
  2. Make the behavior / naming rules the same in the GraphQL API and the web UI.

Addendum: As of today (May 2023) the API changes the characters within ASCII range (below u+0080) as follow (column U is Unicode codepoint, column A is original character, column B is the replacement when using the API, column N is the character description):

U      A B N
u+0020     Space
u+0021 ! ! Exclamation mark
u+0023 # _ Number
u+0024 $ _ Dollar
u+0025 % _ Percent
u+0026 & _ Ampersand
u+0027 ' ' Single quote
u+0028 ( ( Open parenthesis
u+0029 ) ) Close parenthesis
u+002A * * Asterisk
u+002B + _ Plus
u+002C , _ Comma
u+002D - - Hyphen
u+002E . . Dot
u+002F /   Slash
u+003A :   Colon
u+003B ; _ Semicolon
u+003C < _ Less than
u+003D = _ Equals
u+003E > _ Greater than
u+003F ? _ Question mark
u+0040 @ _ At symbol
u+005B [ _ Opening bracket
u+005C \   Backslash
u+005D ] _ Closing bracket
u+005E ^ _ Caret
u+005F _ _ Underscore
u+0060 ` ` Grave accent
u+007B { _ Opening brace
u+007C | _ Vertical bar
u+007D } _ Closing brace
u+007E ~ _ Tilde

And yes, amazingly, you can indeed name a file *.pdf when uploading it via GraphQL API !


Hello there @rof,

Thank you for the feedback!

I will share this with our team so that we can soon add this to our documentation.