It may be worth looking at the source for the File Dropper widget in the Marketplace. This allows a React widget to upload images to a Mendix application, so you can hopefully find the logic on how do this in there, and then use that in your code.
https://github.com/mendixlabs/mendix-file-dropper
Looking at the code, it looks like it’s using mx.data.saveDocument to do this after the object has first been created and it’s guid returned.
https://apidocs.rnd.mendix.com/9/client/mx.data.html#.saveDocument
I hope this helps you find a working solution.