Hi,
You can use the Java action FiledocumentToFile from community commons and move the file to a temp path and use that custom path for the Rest API input.
If you have deployed your app to On-prem/Private cloud you can define the path while saving the file document and again this creates two separate files one inside Mendix and another in your file system, Make sure to remove your Mendix object to eliminate disk space consumption on your node.
Also, Take a look at FTPS Module. This has some extensibility for saving your file to a different path.
Hope this helps!