I'm trying to generate a presigned url to a S3 folder (which itself contains more folders/files) and distribute it between my clients so they can download its content. i.e. by clicking the link, the users will download the folder to their local disk.
However, I keep getting a "no such key" error in an XML dialogue.
I'm using client.generate_presigned_url() from boto3 sdk
def create_presigned_url(bucket, object):
try:
url = s3_client.generate_presigned_url(
'get_object',
Params={
'Bucket': bucket,
'Key': object
},
ExpiresIn=240,
HttpMethod='GET'
)
except ClientError as e:
print(e)
return None
return url
this is the error message:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>output/BARNES/070419/APR19BAR/</Key>
<RequestId>E6BE736FE945FA22</RequestId>
<HostId>
hk3+d+***********************************************************+EO2CZmo=
</HostId>
</Error>