Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

upload bytes to s3 python

import boto3
from pprint import pprint
import pathlib
import os

def upload_file_using_client():
    """
    Uploads file to S3 bucket using S3 client object
    :return: None
    """
    s3 = boto3.client("s3")
    bucket_name = "binary-guy-frompython-1"
    object_name = "sample1.txt"
    file_name = os.path.join(pathlib.Path(__file__).parent.resolve(), "sample_file.txt")

    response = s3.upload_file(file_name, bucket_name, object_name)
    pprint(response)  # prints None
Comment

PREVIOUS NEXT
Code Example
Python :: online python compiler 
Python :: py function 
Python :: strip characters from a string python 
Python :: python sort comparator 
Python :: python divide array into n parts 
Python :: Concat Sort codechef solution 
Python :: qt set focus 
Python :: pdf to string python 
Python :: python doctype 
Python :: isolationforest estimators 
Python :: python install progressbar 
Python :: while true loop python 
Python :: mysql store numpy array 
Python :: python common elements in two arrays 
Python :: datetime print the current time 
Python :: len of iterator python 
Python :: random integer 
Python :: count elements in list python 
Python :: Django delete a session value 
Python :: Sum of Product 1 
Python :: python dictionary key in range 
Python :: choose value none in pandas 
Python :: pd.concat has nan 
Python :: python random choices weights 
Python :: tuple in python 
Python :: if df[col].unique()==2 
Python :: python form html 
Python :: heapsort python 
Python :: filter dataframe with a list of index 
Python :: drop dataframe columns 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =