AnyEvent-Net-Amazon-S3
view release on metacpan or search on metacpan
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
bin/s3cl_ae
cpanfile
dist.ini
examples/backup_cpan.pl
lib/AnyEvent/Net/Amazon/S3.pm
lib/AnyEvent/Net/Amazon/S3/Bucket.pm
lib/AnyEvent/Net/Amazon/S3/Client.pm
lib/AnyEvent/Net/Amazon/S3/Client/Bucket.pm
lib/AnyEvent/Net/Amazon/S3/Client/Object.pm
lib/AnyEvent/Net/Amazon/S3/HTTPRequest.pm
lib/AnyEvent/Net/Amazon/S3/Request.pm
lib/AnyEvent/Net/Amazon/S3/Request/AbortMultipartUpload.pm
lib/AnyEvent/Net/Amazon/S3/Request/CompleteMultipartUpload.pm
lib/AnyEvent/Net/Amazon/S3/Request/CreateBucket.pm
lib/AnyEvent/Net/Amazon/S3.pm view on Meta::CPAN
);
# a bucket is a globally-unique directory
# list all buckets that i own
my $response = $s3->buckets;
foreach my $bucket ( @{ $response->{buckets} } ) {
print "You have a bucket: " . $bucket->bucket . "\n";
}
# create a new bucket
my $bucketname = 'acmes_photo_backups';
my $bucket = $s3->add_bucket( { bucket => $bucketname } )
or die $s3->err . ": " . $s3->errstr;
# or use an existing bucket
$bucket = $s3->bucket($bucketname);
# store a file in the bucket
$bucket->add_key_filename( '1.JPG', 'DSC06256.JPG',
{ content_type => 'image/jpeg', },
) or die $s3->err . ": " . $s3->errstr;
lib/AnyEvent/Net/Amazon/S3.pm view on Meta::CPAN
# list files in the bucket
$response = $bucket->list_all
or die $s3->err . ": " . $s3->errstr;
foreach my $key ( @{ $response->{keys} } ) {
my $key_name = $key->{key};
my $key_size = $key->{size};
print "Bucket contains key '$key_name' of size $key_size\n";
}
# fetch file from the bucket
$response = $bucket->get_key_filename( '1.JPG', 'GET', 'backup.jpg' )
or die $s3->err . ": " . $s3->errstr;
# fetch value from the bucket
$response = $bucket->get_key('reminder.txt')
or die $s3->err . ": " . $s3->errstr;
print "reminder.txt:\n";
print " content length: " . $response->{content_length} . "\n";
print " content type: " . $response->{content_type} . "\n";
print " etag: " . $response->{content_type} . "\n";
print " content: " . $response->{value} . "\n";
lib/AnyEvent/Net/Amazon/S3/Client/Object.pm view on Meta::CPAN
my $object = $bucket->object(
key => 'images/my_hat.jpg',
content_type => 'image/jpeg',
etag => $md5_hex,
size => $size,
);
$object->put_filename('hat.jpg');
# download the value of the object into a file
my $object = $bucket->object( key => 'images/my_hat.jpg' );
$object->get_filename('hat_backup.jpg');
# use query string authentication
my $object = $bucket->object(
key => 'images/my_hat.jpg',
expires => '2009-03-01',
);
my $uri = $object->query_string_authentication_uri();
=head1 DESCRIPTION
( run in 1.849 second using v1.01-cache-2.11-cpan-49f99fa48dc )