Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Amazon-S3 CPAN distribution.

Report information
The Basics
Id: 57992
Status: resolved
Priority: 0/
Queue: Net-Amazon-S3

People
Owner: Nobody in particular
Requestors: arthas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.53
Fixed in: (no value)



Subject: Add support for Content-Disposition header
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.
Subject: Net-Amazon-S3_content_disposition.patch
--- portage/dev-perl/Net-Amazon-S3/Object.pm_orig +++ lib64/perl5/vendor_perl/5.12.1/Net/Amazon/S3/Client/Object.pm @@ -30,6 +30,12 @@ required => 0, default => 'binary/octet-stream' ); +has 'content_disposition' => ( + is => 'ro', + isa => 'Str', + required => 0, + default => 'inline' +); has 'content_encoding' => ( is => 'ro', isa => 'Str', @@ -110,6 +116,7 @@ 'Content-MD5' => $md5_base64, 'Content-Length' => length $value, 'Content-Type' => $self->content_type, + 'Content-Disposition' => $self->content_disposition, }; if ( $self->expires ) {
Show quoted text
> This simple patch for Net::Amazon::S3::Object.pm adds support for
Fixing myself, the name of the module is really: Net::Amazon::S3::Client::Object
Hello! Here's a better patch (against version 0.56) for adding content-disposition. Is it possible to apply this? Thanks, Michele.
Subject: Net-Amazon-S3-Client-Object_disposition.patch
--- /usr/lib/perl5/vendor_perl/5.14.2/Net/Amazon/S3/Client/Object.pm 2011-12-30 10:17:53.000000000 -0500 +++ Net/Amazon/S3/Client/Object.pm 2011-12-30 10:55:50.000000000 -0500 @@ -36,6 +36,11 @@ isa => 'Str', required => 0, ); +has 'content_disposition' => ( + is => 'ro', + isa => 'Str', + required => 0, +); __PACKAGE__->meta->make_immutable; @@ -120,6 +125,9 @@ 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,
Merged, apologies for the delay. Thank you for the patch, a new release should go out later this weekend.