You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you reached this page like me and found nothing on StackOverflow, you can use normal strings as the parameter to create text files. Here's a sample HTML one:
response=s3_client.put_object(
Bucket='your-s3-bucket-name',
Body='a big ole string, or html tags like <h1>Yooo</h1>',
Key='folder/path/index.html',
ServerSideEncryption='AES256'
)
In the documentation for put_object, Boto3 docs say that Body is simply:
and give the example:
Empirically, though, a Python file-like object works just fine. And the automated tests depend on this functionality, so it's probably not going away.
It would be nice if the documentation reflected that Body didn't have to be just bytes.
The text was updated successfully, but these errors were encountered: