simmac / threema-msgapi-sdk-java

Gateway MsgApi SDK - Java
https://gateway.threema.ch
Other
1 stars 3 forks source link

Unknown filetypes are not sent #12

Open simmac opened 8 years ago

simmac commented 8 years ago

Files with a type unknown to File.probeContentType() (or URLConnection.guessContentTypeFromName, so this issue is not dependent on #11) can't be sent in E2E-mode. The two named methods return null for unknown filetypes, the Gateway SDK seems to ignore files with mimeType=null.

I would recommend checking for null when calling the filetype-function and using either MIME-type application/unknown or application/octet-stream for unknown filetypes (and maybe notifying the sender that this file will be sent as unknown via console output).