“Datei in S3 hochladen” Code-Antworten

Datei in S3 hochladen

# 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

Datei in AWS S3 hochladen

var AWS = require('aws-sdk');
AWS.config.update({accessKeyId: "ACCESS_KEY",secretAccessKey: 'SECRET_KEY'});
var s3bucket = new AWS.S3({params: {Bucket: 'BUCKET_NAME'}});
function uploadFileOnS3(fileName, fileData){
    var params = {
      Key: fileName,
      Body: fileData,
    };
    s3bucket.upload(params, function (err, res) {               
        if(err)
            console.log("Error in uploading file on s3 due to "+ err)
        else    
            console.log("File successfully uploaded.")
    });
}
perl wizz

hochladen auf S3


aws s3 cp --recursive --acl public-read ./www s3://YourBucketNAme/
Gogo

Ähnliche Antworten wie “Datei in S3 hochladen”

Fragen ähnlich wie “Datei in S3 hochladen”

Weitere verwandte Antworten zu “Datei in S3 hochladen” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen