creates downloadRemoteFile method