Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add support for Content-Disposition header #5

Merged
merged 1 commit into from

2 participants

@lordarthas

This simple patch for Net::Amazon::S3::Object.pm adds support for providing the Content-Disposition header to S3, which is very useful to provide a file name and wether a file should be download inline/as attachment via the public Amazon link.

@pfig pfig merged commit bef170b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2012
  1. Support for Content-Disposition header

    Michele Beltrame authored
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Net/Amazon/S3/Client/Object.pm
View
8 lib/Net/Amazon/S3/Client/Object.pm
@@ -33,6 +33,11 @@ has 'content_type' => (
required => 0,
default => 'binary/octet-stream'
);
+has 'content_disposition' => (
+ is => 'ro',
+ isa => 'Str',
+ required => 0,
+);
has 'content_encoding' => (
is => 'ro',
isa => 'Str',
@@ -122,6 +127,9 @@ sub put {
if ( $self->content_encoding ) {
$conf->{'Content-Encoding'} = $self->content_encoding;
}
+ if ( $self->content_disposition ) {
+ $conf->{'Content-Disposition'} = $self->content_disposition;
+ }
my $http_request = Net::Amazon::S3::Request::PutObject->new(
s3 => $self->client->s3,
Something went wrong with that request. Please try again.