#NEWLINE# def set_contents_from_filename( self , filename , headers = None , replace = True , cb = None , num_cb = 10 , policy = None , md5 = None , reduced_redundancy = False , encrypt_key = False ) : #NEWLINE# #INDENT# "\n        Store an object in S3 using the name of the Key object as the\n        key in S3 and the contents of the file named by 'filename'.\n        See set_contents_from_file method for details about the\n        parameters.\n\n        :type filename: string\n        :param filename: The name of the file that you want to put onto S3\n\n        :type headers: dict\n        :param headers: Additional headers to pass along with the\n                        request to AWS.\n\n        :type replace: bool\n        :param replace: If True, replaces the contents of the file\n                        if it already exists.\n\n        :type cb: function\n        :param cb: a callback function that will be called to report\n                   progress on the upload.  The callback should accept\n                   two integer parameters, the first representing the\n                   number of bytes that have been successfully\n                   transmitted to S3 and the second representing the\n                   size of the to be transmitted object.\n\n        :type cb: int\n        :param num_cb: (optional) If a callback is specified with\n                       the cb parameter this parameter determines the\n                       granularity of the callback by defining\n                       the maximum number of times the callback will\n                       be called during the file transfer.\n\n        :type policy: :class:`boto.s3.acl.CannedACLStrings`\n        :param policy: A canned ACL policy that will be applied to the\n                       new key in S3.\n\n        :type md5: A tuple containing the hexdigest version of the MD5\n                   checksum of the file as the first element and the\n                   Base64-encoded version of the plain checksum as the\n                   second element.  This is the same format returned by\n                   the compute_md5 method.\n        :param md5: If you need to compute the MD5 for any reason prior\n                    to upload, it's silly to have to do it twice so this\n                    param, if present, will be used as the MD5 values\n                    of the file.  Otherwise, the checksum will be computed.\n\n        :type reduced_redundancy: bool\n        :param reduced_redundancy: If True, this will set the storage\n                                   class of the new Key to be\n                                   REDUCED_REDUNDANCY. The Reduced Redundancy\n                                   Storage (RRS) feature of S3, provides lower\n                                   redundancy at lower storage cost.\n        :type encrypt_key: bool\n        :param encrypt_key: If True, the new copy of the object will\n                            be encrypted on the server-side by S3 and\n                            will be stored in an encrypted form while\n                            at rest in S3.\n        " #NEWLINE# fp = open ( filename , 'rb' ) #NEWLINE# def _set_contents_from_filename( response ) : #NEWLINE# #INDENT# fp . close ( ) #NEWLINE# if callable ( callback ) : #NEWLINE# #INDENT# callback ( response ) #NEWLINE# #UNINDENT# #UNINDENT# self . set_contents_from_file ( fp , headers , replace , cb , num_cb , policy , md5 , reduced_redundancy , encrypt_key = encrypt_key , callback = _set_contents_from_filename )