From a05c415f2cf613d754e88e6736de953288a12f92 Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Tue, 2 Sep 2008 15:40:51 +0200 Subject: [PATCH] Better shape --- eg/sample-form.pl | 71 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/eg/sample-form.pl b/eg/sample-form.pl index 66fd8b5..8b7f87e 100644 --- a/eg/sample-form.pl +++ b/eg/sample-form.pl @@ -17,14 +17,14 @@ perl sample-form.pl DOCUMENTATION exit 1; -} +} ## end if (@ARGV != 3) my ($aws_key, $aws_secret, $bucket) = @ARGV; my $policy = Net::Amazon::S3::Policy->new( - expiration => time() + 60 * 60, # one-hour policy + expiration => time() + 60 * 60, # one-hour policy conditions => [ - 'key starts-with restricted/', # restrict to here - "success_action_redirect starts-with http://$bucket.s3.amazonaws.com/restricted/", + 'key starts-with restricted/', # restrict to here +"success_action_redirect starts-with http://$bucket.s3.amazonaws.com/restricted/", "bucket eq $bucket", 'Content-Type starts-with image/', 'x-amz-meta-colour *', @@ -35,14 +35,14 @@ my $policy = Net::Amazon::S3::Policy->new( print {*STDERR} $policy->json(), "\n"; my $template = do { local $/; }; -print {*STDOUT} render($template, - policy64 => $policy->base64(), - signature64 => $policy->signature_base64($aws_secret), +print {*STDOUT} render( + $template, + policy => $policy->base64(), + signature => $policy->signature_base64($aws_secret), AWSAccessKeyId => $aws_key, - bucket => $bucket, + bucket => $bucket, ); - __END__ An example form page for Amazon S3 HTTP POST interface + -

Put your data here...

+

Amazon S3 HTTP POST

-

+

+ File Upload + - - + + @@ -79,15 +110,19 @@ __END__ +
+ -
- + -
- +
+ + + + +
-

-- 2.11.4.GIT