The title says most of it. I have the following code:
copySource := bucket + "/" + sourcePath + "/" + filenameIn
destPath := lambdaParams.DestinationPath + "/" + filenameIn
copyObjectInput := s3.CopyObjectInput{
CopySource: aws.String(copySource),
Bucket: aws.String(bucket),
Key: aws.String(destPath),
}
if filepath.Ext(filenameIn) == ".pdf" {
copyObjectInput.SetContentType("application/pdf").SetContentDisposition("inline; filename=\"" + filenameIn + "\"")
}
_, err := svc.CopyObject(©ObjectInput)
if err != nil {
logErrorAndInformGFS(err, "S3 copy error.", c, log, filenameIn)
return err
}
I am setting both the Content-Type
and the Content-Disposition
with the hope of having the copied object have the new values from Content-Type
and Content-Disposition
. However, I can see in AWS that the copied file has the same metadata as the original file. What am I leaving out?