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 in AWS by Archana
• 5,360 points
25 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by datageek
• 2,870 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
• 3,770 points
34 views
+3 votes
5 answers

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

First Option sm3cmd Use s3cmd s3cmd get s3://AWS_S3_Bucket/dir/file Take a ...READ MORE

answered Aug 29, 2018 in AWS by Priyaj
• 56,120 points
818 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
• 3,770 points
23 views
0 votes
1 answer

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,360 points
3,554 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
• 56,120 points
85 views
0 votes
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
• 56,120 points
188 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,520 points
104 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Is it possible to use own scheduler with Amazon ECS?

ECS provides Blox, a collection of open ...READ MORE

answered Nov 5, 2018 in AWS by datageek
• 2,870 points
20 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.