#24 — File name is split at first '.' when generating title

State Resolved
Version: 1.4
Area Functionality
Issue type Bug
Severity Medium
Submitted by Manuel Reinhardt
Submitted on Jun 15, 2012
Responsible Thomas Desvenain
Target release:
If no title is passed to QuickUploadCapableFileFactory, a title is generated from the filename (browser/uploadcapable.py:64).

title = name.split('.')[0].replace('_',' ').replace('-',' ')

Everything after the first '.' is discarded, so if I upload a file "bla.some_important_text.pdf", the title is only "bla".
I would expect it to be "bla some important text". Changing the above line to

'.'.join(name.split('.')[:-1]).replace('_',' ').replace('-',' ').replace('.', ' ')

will do this.
Steps to reproduce:
Upload a file with multiple '.'s in the filename
Added by Manuel Reinhardt on Jun 15, 2012 02:21 PM
Sorry, the full replacement line would of course be

title = '.'.join(name.split('.')[:-1]).replace('_',' ').replace('-',' ').replace('.', ' ')
Added by Thomas Desvenain on Jul 10, 2012 08:17 PM
Issue state: UnconfirmedResolved
Responsible manager: (UNASSIGNED)thomasdesvenain
fixed in master

No responses can be added.