diff --git a/libumccr/aws/libs3.py b/libumccr/aws/libs3.py index 008fcaa..e45d4d5 100644 --- a/libumccr/aws/libs3.py +++ b/libumccr/aws/libs3.py @@ -111,7 +111,7 @@ def bucket_exists(bucket) -> bool: return False -def presign_s3_file(bucket: str, key: str) -> (bool, str): +def presign_s3_file(bucket: str, key: str, content_disposition:str ='inline') -> (bool, str): """ Generate a presigned URL https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.generate_presigned_url @@ -122,7 +122,7 @@ def presign_s3_file(bucket: str, key: str) -> (bool, str): :return tuple (bool, str): (true, signed_url) if success, otherwise (false, error message) """ try: - return True, s3_client().generate_presigned_url('get_object', Params={'Bucket': bucket, 'Key': key}) + return True, s3_client().generate_presigned_url('get_object', Params={'Bucket': bucket, 'Key': key, 'ResponseContentDisposition': content_disposition}) except ClientError as e: message = f"Failed to sign the specified S3 object (s3://{bucket}/{key}). Exception - {e}" logger.error(message) diff --git a/setup.py b/setup.py index a899696..430d83a 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="libumccr", - version="0.4.0rc3", + version="0.4.0rc4", author="UMCCR and Contributors", author_email="services@umccr.org", description="UMCCR Reusable Python modules",