Open a local file and write it remotely.

def write_to_remote(self, filepath_from, filepath_to, mtime_dt=None):
        """Open a local file and write it remotely."""

        self.__log.debug("Writing L[%s] -> R[%s]." % (filepath_from, 
                                                      filepath_to))

        with open(filepath_from, 'rb') as file_from:
            with SftpFile(self, filepath_to, 'w') as sf_to:
                while 1:
                    part = file_from.read(MAX_MIRROR_WRITE_CHUNK_SIZE)
                    sf_to.write(part)

                    if len(part) < MAX_MIRROR_WRITE_CHUNK_SIZE:
                        break

        if mtime_dt is None:
            mtime_dt = datetime.now()

        self.utimes_dt(filepath_to, mtime_dt, mtime_dt)