s3_demo_1.py 250 B

123456789
  1. def upload_file(file_name, bucket):
  2. """
  3. Function to upload a file to an S3 bucket
  4. """
  5. object_name = file_name
  6. s3_client = boto3.client('s3')
  7. response = s3_client.upload_file(file_name, bucket, object_name)
  8. return response