It could likely be a problem with encoding.
- Can you download the files - are they of right size?
- For text files: did you see the content by forcibly opening on a text editor like Notepad? If you can see the content, change the file encoding and reupload to Salesforce. Will this make the problem go away?
A simple test: Get Base64 encoded string from file, invoke REST API & check whether the file goes through.
curl <url>/Document/ -H "Authorization: Bearer token" -H "Content-Type: multipart/form-data; boundary=\"boundary_string\"" --data-binary @att_test.json
Content-Disposition: form-data; name="entity_attachment";
Content-Disposition: form-data; name="Body"; filename="test.jpg"