'Uploads a file to the remote server. Returns the remote filename.
Arguments:
filename(str): The local filename to download
remote(str): The remote filename to save it to. Default is to infer it from the local filename.'

def upload_file(self, filename, remote=None):

    if (remote == None):
        remote = os.path.normpath(filename)
        remote = os.path.basename(remote)
        remote = os.path.join(self.cwd, remote)
    with open(filename) as fd:
        data = fd.read()
    self.info(('Uploading    %r    to    %r' % (filename, remote)))
    self.upload_data(data, remote)
    return remote
