Get In Touch
TC 73/1214,Enchakal
Vallakadavu(PO), Thiruvananthapuram,
Kerala- 695008.

How to upload xml file to amazon s3 bucket

Upload file to s3 bucket

1.  Setup the connection
2.  Load the xml
3.  Drop to your Bucket

Simple as that…

for Info Overload Here

import boto

# setup boto bucket connector and key
connector = boto.connect_s3('awsAccessKeyId', 'awsSecretAccessKey')
bucket = connector.get_bucket('awsStorageBucketName')
botoKey = boto.s3.key.Key(bucket)

# open the file to be uploaded
inFileName = 'file.xyz'
inFileObject = open(inFileName)

s3FileName = "path/to/file.xyz"    # path in s3 bucket
botoKey.key = s3FileName    # set filepath as key
botoKey.content_type = 'text/xml'
botoKey.set_contents_from_file(inFileObject)    # writing to file

"""
# botoKey.set_acl('public-read')    <== include this to make the upload public
"""

inFileObject.close()

 

This website stores cookies on your computer.

START A CONVERSATION

Please enable JavaScript in your browser to complete this form.

Junior Scrum Master

Business Development Executive

Business Operation Analyst

Senior Python Django Developer

Technical Project Manager

React JS Developer

MBA Fresher Recruitment ( 2022 & 2023 passed out)