Fix bug when adding a text file to multipart request

- move some code outside from `if (type:conformsToUTI)`