#2976 when uploading filename lose its trailing spaces at begin and end