'How to copy a file with spaces in its file name from one bucket to the other using AWS CLI (Dos)

I am trying to copy a file by the same My CV 2017.pdf from one AWS bucket to the other using the AWS command line. But I am getting error doing that.

I tried using My\ Cv\ 2017.pdf and 'My CV 2017.pdf', both did not work.



Solution 1:[1]

Use double quotes. For example:

aws s3 cp "s3://source-bucket/My CV 2017.pdf" "s3://destination-bucket/My CV 2017.pdf"

Solution 2:[2]

Using double quotes can solve the problem when you have single file to upload.

For the bulk files, try uploading directory with recursive option

aws s3 mv ../directory-with-files/ s3://bucket-name/folder-to-upload/ --recursive

Solution 3:[3]

This is resolved by adding
signature_v2 = True
to the s3cfg file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Khalid T.
Solution 2 Sajan Sharma
Solution 3 Vineet Kumar