def put(self, local, remote, contents=None, quiet=False):
remote_dir = os.path.dirname(remote)<EOL>remote_file = os.path.basename(local)if remote.endswith('<STR_LIT:/>') else os.path.basename(remote)<EOL>if contents:<EOL><INDENT>local_file = buffer_type(contents)<EOL><DEDENT>elif isinstance(local, file_type):<EOL><INDENT>local_file = local<EOL><DEDENT>else:<EOL><INDENT>local_file = open(local, '<STR_LIT:rb>')<EOL><DEDENT>current = self.conn.pwd()<EOL>self.descend(remote_dir, force=True)<EOL>size = <NUM_LIT:0><EOL>try:<EOL><INDENT>self.conn.storbinary('<STR_LIT>' % remote_file, local_file)<EOL>size = self.conn.size(remote_file)<EOL><DEDENT>except:<EOL><INDENT>if not quiet:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>local_file.close()<EOL>self.conn.cwd(current)<EOL><DEDENT>return size<EOL>
Puts a local file (or contents) on to the FTP server

            local can be:
                a string: path to inpit file
                a file: opened for reading
                None: contents are pushed