How To Upload Images to Amazon S3 Using Perl

0 votes

I am trying to upload images to S3 using perl. Here is the code snippet:


my $keyname = 'testing.txt';
my $value   = 'T';
$bucket->add_key(
   $keyname, $value,
   {   content_type        => 'text/plain',
       'x-amz-meta-colour' => 'orange',
   }
);

Is it right? Do i have to make any changes?

Mar 15, 2019 in AWS by Archana
• 5,640 points
1,582 views

1 answer to this question.

0 votes

That code won't upload the file - it's simply setting the value associated with the key "testing.txt" to "T". If you want to upload a file you could use the add_key_filename method:

That method works like add_key except the value is assumed to be a filename on the local file system. The file will be streamed rather then loaded into memory in one big chunk

answered Mar 15, 2019 by datageek
• 3,090 points

Related Questions In AWS

0 votes
1 answer

How to upload a file to Amazon S3 without passing it my server?

This article pretty much explains the entire ...READ MORE

answered Aug 14, 2018 in AWS by Archana
• 4,170 points
3,239 views
+3 votes
6 answers

How to move files from amazon ec2 to s3 bucket using command line

Hey, 3 ways you can do this: To ...READ MORE

answered Oct 9, 2018 in AWS by Omkar
• 69,220 points
19,957 views
0 votes
1 answer

How to upload an object into Amazon S3 in Lambda?

I suspect you are calling the context.done() function before s3.upload() has ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,170 points
1,173 views
+1 vote
2 answers

How to read a csv file stored in Amazon S3 using csv.DictReader

The code would be something like this: import ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
54,371 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,100 points
5,913 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,100 points
5,179 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,847 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP