Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

aws ec2 upload file

scp -i ~/Downloads/file.pem local_image_file user@ec2_elastic_ip:/home/user/images/
Comment

upload file to AWS S3

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.")
    });
}
Comment

upload file to aws

# 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)

Comment

upload to aws

aws s3 cp /css/ s3://yourbucketname/css/ --recursive
Comment

PREVIOUS NEXT
Code Example
Python :: python get last item in a list 
Python :: get char from ascii value python 
Python :: while loops python 
Python :: username python 
Python :: Word2Vec 4.0 Gensim model python dataframe 
Python :: variables and data types in python 
Python :: pandas como quitar comillas simples de una columna 
Python :: numpy array deepcopy 
Python :: dataframe number of unique rows 
Python :: print list in one line python 
Python :: axios django post data 
Python :: check if all elements in list are equal 
Python :: python telegram bot login 
Python :: turtle graphics documentation|pensize 
Python :: pandas replace values 
Python :: make sure it only has letters and numbers python 
Python :: staticmethod python 
Python :: comtypes python 
Python :: Python how to use __lt__ 
Python :: csv read python 
Python :: Local to ISO 8601: 
Python :: Disctionary to Array 
Python :: pandas resample friday 
Python :: logical operators python 
Python :: python t test 
Python :: how to take space separated input in pyhon dicationary 
Python :: string python 
Python :: method get first last name python 
Python :: defaultdict python 
Python :: palindrome words python 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =