Your file is not loaded as a file, but as a document. Since a document has no method for upload a file, it does not work. To work, your file has to be handled as .... a file.
After some research, I have found that the mapping of extensions to content type is handled in Plone by a little known database named 'content types registry'. AFAIK there is no UI to manage it (I'd be happy to be shown ignorant but I have searched docs and Internet for 2 good hours without success). I looked at the registry (no joy) and the ZMI (don't seem to be any way either).
Well... there is always the dirty way.
You can use it too if you are not afraid.
Fire up Plone in debug mode (bin/instance debug or something like that)
>>> from zope.component.hooks import setSite
['txt', 'stx', 'rst', 'rest', 'py']
>>> plone.portal_registry.content_type_registry.predicates['ATDocument_ext'].extensions=['stx', 'rst', 'rest', 'py']
(<MajorMinorPredicate at text>, 'Document')
<MajorMinorPredicate at text>
>>> import transaction
then exit the debug mode and restart Plone normally. Works for me (TM)
If you don't understand what this does, the txt extension is associated with an old Archetypes type, the first change removes the txt extension from it. Then the mimetype text/* is associated with 'Document'. the second change associates it with the 'File' content type.
If there is a bad side-effect your can revert the changes by doing the opposite.
Please post if you see a problem.
As of your question, is this a bug ?
IMO, having to fiddle extension associations to get proper handling of files is not really a bug, it is done in many other systems (Windows, browsers, etc...)
Not having an user friendly way to change these extension associations is not truly a bug, if this is correct I'd say that it is more an oversight.