I finally gave up and went with crafting the right scp command and using the system command to run it. Probably not the right thing to do, but it is working.
If someone gives me a good reason why this is a horrible plan, I'll give SFTP a try.
Update: Yes I had to set the boxes up to
scp without a password.