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

Fixes #428
I need to reinstall phpDoc and verify that that is indeed the correct way of stating that a variable can have two different types. Last time I tried PEAR gave me some errors that I don't recall. I'll try to try again at some point...