- my $res;
- if (! $writer) {
- $res=$bucket->add_key($key, $content, \%opts);
- }
- else {
- # read back in the file that the writer emitted
- $res=$bucket->add_key_filename($key, "$destdir/$file", \%opts);
- }
- if ($res && $key=~/(^|\/)index.$config{htmlext}$/) {
- # index.html files are a special case. Since S3 is
- # not a normal web server, it won't serve up
- # foo/index.html when foo/ is requested. So the
- # file has to be stored twice. (This is bad news
- # when usedirs is enabled!)
- $key=~s/index.$config{htmlext}$//;
+
+ # If there are multiple keys to write, data is sent
+ # multiple times.
+ # TODO: investigate using the new copy operation.
+ # (It may not be robust enough.)
+ foreach my $key (@keys) {
+ my $res;