SFTP: make it so files can be downloaded into resources or upload from resources

Fixes #428
I just think it's easier on the eyes than `if (...) {} else if (...) {} else if (...)`