I have a similar problem in Mendix 8. I'm receiving a file from a SOAP integration Base64 encoded. I'm decoding it with Decode64ToFile and many characters are not decoded correctly which ends up in corrupted files (pdfs for example have the right amount of pages, but they are all empty and excel files won't even open).
SOAP UI receives the files correctly.
I think we need to check from the database perspective if app is working fine in your local env.
App in Mendix cloud might use database different to that in your local. We normally use file based database (H2) in local env.
Can you try setting up postgres database in your local env and point your app to that and validate the functionality. If it works then, we need to understand the file storage service of your cloud app.
Mendix under the hood uses S3 buckets as file storage medium in AWS Cloud, and I am not sure it is part of free APP (If your app is free).
If your app is licenced the above file storage cause can be ignored.
Also, refer to Live logs in cloud for more information regarding the error