Technical analysis as a starter/context for implementing it:
The Nexus 3 API provides a simple REST upload method with directory path and filename (raw).