0

Im trying to do a simple upload of a .txt file with a few lines in it. I have used AWS' own example, but getting an error. I have searched for a few hours and tried 5-6 different upload methodes, all giving the same error message. What am I missing?

s3 = boto3.client('s3')
filename = 'file.txt' bucket_name = 'my-bucket'
s3.upload_file(filename, bucket_name, filename)

Error:

TypeError: expected string or buffer

1 Answer 1

1

Okay, so this was me being stupid..

I had my bucket defind as

bucket_name = s3.Bucket('hs-sftp-abc-shopping-sto')

And the upload function as

s3.upload_file(filename, bucket_name, filename)

But the bucket name should just be a string, and not a s3.bucket().

FML :-)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.