Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:16:09+00:00 2026-06-14T14:16:09+00:00

I am working with this code currently: #!/usr/bin/env python import boto import boto.s3 from

  • 0

I am working with this code currently:

#!/usr/bin/env python

import boto
import boto.s3
from boto.s3.key import Key

AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''

filename = 'test.zip'    
bucket_name = AWS_ACCESS_KEY_ID.lower() + '-mah-bucket'
conn = boto.connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

bucket = conn.create_bucket(bucket_name, location=boto.s3.connection.Location.DEFAULT)

k = Key(bucket)
k.key = 'my test file'
k.set_contents_from_filename(filename)

I have two questions. Firstly, I believe this code creates a bucket as well as doing an upload. Thing is I don’t want a bucket created, since I already have one in place. In order to do this do I just change it to this:

k = Key(bucket_name)

and get rid of this:

bucket = conn.create_bucket(bucket_name, location=boto.s3.connection.Location.DEFAULT)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:16:11+00:00Added an answer on June 14, 2026 at 2:16 pm

    Actually, instead of conn.create_bucket(…), just do:

    bucket = conn.get_bucket(bucket_name)
    k = Key(bucket)
    

    Also, I should probably point out that it seems silly to me to name your buckets based on the AWS_ACCESS_KEY_ID, as this is not really needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got this code working and it to return the last tweet from my
Hello currently working with this code $qry_display = SELECT student_id, fname, sex, lname, mname,
Hello currently I'm working with this line of code: if( $get_display->level== Nursery){ $lbl=Kinder; }
I'm currently doing something like this in some code I'm working on right now:
This code is currently working, but it looks terrible - and probably can be
As a beginner in Ocaml, I have this current working code: ... let ch_in
i am new in programming under linux and trying to get working this code:
I've been working on this code to implement a clickable Share button for ShareThis,
I am working on this code but even after consulting other threads I am
Hi I have been working on this code that creates a table with radio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.