'Store an object in a file using the name of the Key object as the
key in file URI and the contents of the file pointed to by \'fp\' as the
contents.
:type fp: file
:param fp: the file whose contents to upload
:type headers: dict
:param headers: ignored in this subclass.
:type replace: bool
:param replace: If this parameter is False, the method
will first check to see if an object exists in the
bucket with the same key.  If it does, it won\'t
overwrite it.  The default value is True which will
overwrite the object.
:type cb: function
:param cb: ignored in this subclass.
:type cb: int
:param num_cb: ignored in this subclass.
:type policy: :class:`boto.s3.acl.CannedACLStrings`
:param policy: ignored in this subclass.
:type md5: A tuple containing the hexdigest version of the MD5 checksum
of the file as the first element and the Base64-encoded
version of the plain checksum as the second element.
This is the same format returned by the compute_md5 method.
:param md5: ignored in this subclass.'

def set_contents_from_file(self, fp, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None):

    if (self.key_type & self.KEY_STREAM_READABLE):
        raise BotoClientError('Stream    is    not    writable')
    elif (self.key_type & self.KEY_STREAM_WRITABLE):
        key_file = self.fp
    else:
        if ((not replace) and os.path.exists(self.full_path)):
            return
        key_file = open(self.full_path, 'wb')
    try:
        shutil.copyfileobj(fp, key_file)
    finally:
        key_file.close()
