I have the same issue
and went up to the point that when the attachment is being sent back from the database as being encoded in utf-8 which in most case is not the original encoding when the attachment was loaded.
this is why the attachement/images are not readable anymore
a word document can be recovered because word can repair this issue, the other type are just not readable anymore
if someone find what s wrong in the code, please , help would be appreciated
regards