“Laden Sie die Datei in S3 Python hoch” Code-Antworten

Boto3 Upload -Datei auf S3 hochladen

import boto3
s3 = boto3.resource('s3')
s3.meta.client.upload_file('/tmp/hello.txt', 'mybucket', 'hello.txt')
Tough Tuatara

Laden Sie die Datei in S3 Python hoch

# easy way
import boto3

s3 = boto3.resource(
    service_name='s3',
    region_name='Your region',
    aws_access_key_id='Your id',
    aws_secret_access_key="Your Key")

bucket = s3.Bucket('your bucket name')

bucket.upload_file(Filename='temp.csv', Key='temp.csv')
# file path __________↑                 ↑ 
# (which you want to upload)            |
#                                       |______path (where you want to upload inside bucket)

Darkstar

Laden Sie das Bild in S3 Python hoch hoch

The AWS SDK for Python provides a pair of methods to upload a file to an S3 bucket. The upload_file method accepts a file name, a bucket name, and an object name.
Frightened Ferret

Ähnliche Antworten wie “Laden Sie die Datei in S3 Python hoch”

Fragen ähnlich wie “Laden Sie die Datei in S3 Python hoch”

Weitere verwandte Antworten zu “Laden Sie die Datei in S3 Python hoch” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen