how to create file in aws S3 using python boto3

Question:

I want to create an empty file in AWS s3 using python.

I’m using boto3 and python.

I want to know apart from the put method is there any way to create files in s3?

Answer:

Assuming that you genuinely want a zero-byte file, you can do it as follows:

Note the lack of a Body parameter, resulting in an empty file.

Leave a Reply