I made it easier
(windows exe file, didn't obfuscate so you can check that it's no more than an uploader)
You'd need .NET Framework 4.6.2 or newer
"C:\path\path\FileUploadProgress.exe" "Uploading print file..." "[output_filepath]" "http://duet_replicator.local/rr_upload?name=gcodes/[output_filename].gcode"
Comments: (for anyone without previous experience with this method)
You must be logged in to you web interface from a browser for that to work