Hello Tirrel,
I think, you might have to write a java code for converting the string into a byte array.
or you can use non persistent objects and you can use it in REST post.
For converting it into the excel file you can make a use of Mx Model Reflection or excel importer
Please see decumentation:
https://docs.mendix.com/howto/integration/using-the-excel-exporter
https://docs.mendix.com/howto/integration/importing-excel-documents