Skip to content

cp command S3toS3 --content-type flag not working #738

Closed

Description

@4o4x

In s5cmd, the --content-type flag does not work when performing an S3 to S3 copy operation with the cp command.

Tests

Object Info

> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key src/test.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:06:17+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "text/plain",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}

AWS CLI Test

> aws --endpoint-url=http://localhost:4566 s3 cp  s3://copy-test/src/test.txt s3://copy-test/dest/test.txt --content-type video/mp4
copy: s3://copy-test/src/test.txt to s3://copy-test/dest/test.txt
> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key dest/test.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:09:34+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "video/mp4",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}

s5cmd test

> s5cmd --endpoint-url=http://localhost:4566 cp --content-type video/mp4 s3://copy-test/src/test.txt s3://copy-test/dest/test2.txt
cp s3://copy-test/src/test.txt s3://copy-test/dest/test2.txt
> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key dest/test2.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:17:09+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "text/plain",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions