Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

boto3 upload to digital digitalocean folder

from boto3 import session
from botocore.client import Config
ACCESS_ID = ''
SECRET_KEY = ''

# Initiate session
session = session.Session()
client = session.client('s3',
region_name='nyc3',
endpoint_url='https://fra1.digitaloceanspaces.com',
aws_access_key_id=ACCESS_ID,
aws_secret_access_key=SECRET_KEY)

# Upload a file to your Space
#client.upload_file(file_location, 'video-search-dataset', file_name)
client.upload_file(file_location,'bucket_name', '%s/%s' % (str(subreddit_name),file_name))
file_url = '%s/%s/%s' % (client.meta.endpoint_url, 'bucket_name', SECRET_KEY)
print ("file URL: ", file_url)
return (file_url)
Comment

PREVIOUS NEXT
Code Example
Python :: python. printing varibles 
Python :: python get num chars 
Python :: python - dashboard 
Python :: python how to extend a class 
Python :: how to save xml file in python 
Python :: pandas form multiindex to column 
Python :: ex:deleate account 
Python :: with suppress(exception) python 
Python :: Pipeline_parameters 
Python :: best api for python 
Python :: how to run matlab script with arguments in python 
Python :: showing typle results with for loop in py in one line 
Python :: index operator in python without input 
Python :: merge python list items by index one after one 
Python :: Filter xarray (dataarray) 
Python :: ploting bargraph with value_counts(with title x and y label and name angle) 
Python :: mostFrequentDays python 
Python :: subprocess open txt file python 
Python :: with statement python 3 files 
Python :: python data engineer interview questions 
Python :: center fig legend 
Python :: how to discover which index labels are in other 
Python :: readme python convert to pdf 
Python :: get queryset 
Python :: what takes more memory string or list python 
Python :: prefetched_related django rest framework 
Python :: left rotation in list 
Python :: create a fibonacci function using a generator python 
Python :: scipy get frequencies of image 
Python :: python tuple range 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =