Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Automating upload of files to Amazon S3 Buckets

by OfficeLinebacker (Chaplain)
on Oct 07, 2013 at 21:31 UTC ( [id://1057312]=perlquestion: print w/replies, xml ) Need Help??

OfficeLinebacker has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, esteemed monks!

So I've been perusing the documentation for Net::Amazon::S3 and I've successfully connected to my S3 account and listed my buckets.

What I'm trying to do now is automate the uploading of a bunch of files to each of my buckets in an automated way. For now I am just testing and I want to upload four files to each bucket. I would basically be copying files from my local hard drive to the bucket. I am having trouble finding documentation of the process. I guess the original interface was "add_key" but that's been deprecated. I guess I have to use a "Client Object" (http://search.cpan.org/~pfig/Net-Amazon-S3-0.59/lib/Net/Amazon/S3/Client/Object.pm) so is that a new object I have to instantiate for each bucket?

I guess I'm a little spoiled when it comes to cpan documentation because I'm not finding this documentation clear at all.

  • Comment on Automating upload of files to Amazon S3 Buckets

Replies are listed 'Best First'.
Re: Automating upload of files to Amazon S3 Buckets
by ltriant (Scribe) on Oct 07, 2013 at 22:53 UTC

    So, you've initialised a Net::Amazon::S3 object with your API details?

    This object has a 'bucket' method, to select a single bucket. This will return a Net::Amazon::S3::Bucket object. You will find what you need in the Net::Amazon::S3::Bucket module docs.

      Thanks for pointing me in the right direction. That documentation looks much better.

      Hi. So I did my research and the file data goes in the "data" field. So I have to open a file stream and essentially stream the file into the "data" field?

      Or I guess File::Slurp would work, and jam that string into the 'data' field (sometimes it's called "value.").

      Also, I am choosing to pronounce it "Bouquet" in honor of Hyacinth.

        Look at the add_key_filename() method. It is for uploading files into S3.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1057312]
Approved by davido
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found