Understanding Automatic Index.html Generation Using Lambda
You were able to generate index.html in any bucket using python boto3.
However, when you open index.html generated by lambda, the browser does not display the contents and downloads them.
Try uploading a file with the same content manually and performing the same behavior, and HTML will appear in your browser.
Is there a difference in permissions due to the difference in the route to be uploaded?
I'm comparing the properties of the files listed in the above two routes, but I can't find any differences.
Please let me know.
aws lambda amazon-s3
Uploads from the management console or through the AWS CLI automatically grant the Content-Type
based on the original file extension, but Boto3 does not have such an action and must.
For example, if you use put_object
, run it with the argument ContentType='text/html'
.
http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.put_object
© 2024 OneMinuteCode. All rights reserved.