Fix uploading of files with special characters

@alex-deaconu please review