I made it easier
App:
https://mega.nz/file/ywgiCS5Y#kHK4-RvvnkdyTL-yI6dlYlC_4e3lTijv3ViF1e0QLiY
(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
Command:
"C:\path\path\FileUploadProgress.exe" "Uploading print file..." "[output_filepath]" "http://duet_replicator.local/rr_upload?name=gcodes/[output_filename].gcode"
curl "http://duet_replicator.local/rr_disconnect"
Preview:
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