Currently, the system will not allow two files to have the same name, globally, across the entire Knowledge Base site. This is very problematic in technical documents where software expects files to have a certain name.
In our case, we need to provide example config files for many different scenarios. If the software in question expects some config files to be named "foo.conf" and others to be named "ding.list", renaming them to be unique across every example would be very confusing for the audience.
The usual solution for this scenario is to create multiple directories (folders). The directory name plus the file name is then still unique.
Indeed, I tried creating different folders in the "Drive" file management tool, but it renames every file I upload to be unique across the entire drive.
It seems that your current implementation uses a single directory on the CDN for the entire site. Presumably the limitation extends from this. The folder structure maintained in the "Drive" is apparently for display purposes only.
It seems like a straight-forward way to fix this would be to extend the folder structure created in "Drive" to the CDN.
For example, if I created folders "simple" and "fruit" in the "Drive", and under the "fruit" folder, further created folders "banana" and "apple", and uploaded a "foo.conf" file to each of them, the resulting CDN paths might be:
The only tricky part would be that existing sites of course expect their Drive folder structure to have no effect on their links. Simply enabling everywhere it would break existing sites. Enabling it only for new folders might still be confusing to people used to the old way. Perhaps some kind of site-global option for "Advanced Drive paths" or something like that could be offered. Once that option was enabled, new folders would have their path reflected in the CDN. Existing folders would continue to use the root for storage, for compatibility. The built-in system folders would be exempted from this treatment regardless.