(self, path, buf, info, meta=None, headers=None)
return threads.deferToThread(
            self.s3_client.put_object,
            Bucket=self.bucket,
            Key=key_name,
            Body=buf,
            Metadata={k: str(v) for k, v in (meta or {}).items()},
            ACL=self.POLICY,
            **extra)
Upload file to S3 storage
Upload file to S3 storage
Upload file to S3 storage
def persist_file(self, path, buf, info, meta=None, headers=None):
        """Upload file to S3 storage"""
        key_name = f'{self.prefix}{path}'
        buf.seek(0)
        extra = self._headers_to_botocore_kwargs(self.HEADERS)
        if headers:
            extra.update(self._headers_to_botocore_kwargs(headers))
        return threads.deferToThread(
            self.s3_client.put_object,
            Bucket=self.bucket,
            Key=key_name,
            Body=buf,
            Metadata={k: str(v) for k, v in (meta or {}).items()},
            ACL=self.POLICY,
            **extra)
def persist_file ( self , path , buf , info , meta = None , headers = None ) : key_name = f'{self.prefix}{path}' buf . seek ( 0 ) extra = self . _headers_to_botocore_kwargs ( self . HEADERS ) if headers : extra . update ( self . _headers_to_botocore_kwargs ( headers ) ) return threads . deferToThread ( self . s3_client . put_object , Bucket = self . bucket , Key = key_name , Body = buf , Metadata = { k : str ( v ) for k , v in ( meta or { } ) . items ( ) } , ACL = self . POLICY , * * extra )