ikebe/p5-Furl-S3 — pull request #2 by holly (2013-04-21 16:48:11+00:00)
Title: Support 5M over multipart upload in my develop branch

I have added some methods Furl::S3.(and testcase)

+ initiate_multipart_upload
+ upload_part
+ complete_multipart_upload
+ more...

### sample

#!/usr/bin/env perl

use strict;
use feature qw(say);
use Furl::S3;

my $aws_access_key_id = "your aws access key";
my $aws_secret_access_key = "your aws secret access key";

my $s3 = Furl::S3->new(
aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key,
);

my $chunk_size = 5_242_880;
my $bucket = "your bucket";
my $key = "large_file";
my $upload_id = $s3->initiate_multipart_upload($bucket, $key);

my $i = 1;
my(@part_numbers, @etags);
open my $fh, "<", $key or die $!;
while (read $fh, my $buffer, $chunk_size) {
my $etag = $s3->upload_part($bucket, $key, $buffer, { uploadId => $upload_id, partNumber => $i });
push @part_numbers, $i;
push @etags, $etag;
$i++;
}
close $fh;
$s3->complete_multipart_upload($bucket, $key, \@part_numbers, \@etags, { uploadId => $upload_id });

If it is good, please merge the source code of the develop branch.