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.