Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Salzmann-Jaeckel
boto
Commits
2c80e2f4
Commit
2c80e2f4
authored
Aug 26, 2020
by
Christian Salzmann-Jaeckel
Browse files
boto: add upload, generate_url example
parent
da660c9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
s3-boto.py
View file @
2c80e2f4
...
...
@@ -26,5 +26,16 @@ for bucket in conn.get_all_buckets():
created
=
bucket
.
creation_date
)
)
# upload file
#bucket = conn.get_bucket(s3_bucket_name)
#key = bucket.new_key('hello.txt')
#key.set_contents_from_string('Hello World!')
bucket
=
conn
.
get_bucket
(
s3_bucket_name
)
hello_key
=
bucket
.
get_key
(
'hello.txt'
)
hello_url
=
hello_key
.
generate_url
(
0
,
query_auth
=
True
)
print
(
hello_url
)
# create bucket
# bucket = conn.create_bucket(s3_bucket_name)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment