Search code examples
windowsamazon-web-servicesamazon-s3amazon-ec2windows-server-2016

Unable to upload file to S3 bucket


I am trying to send a AD backup folder to a AWS s3 bucket on a windows 2016 server machine, via cmd line.

aws s3 cp “D:\WindowsImageBackup” s3://ad-backup/

However I get the below error.

Invalid length for parameter Key, value: 0, valid range: 1-inf

The folder I am trying to upload has some large files in so not sure if its too big. I have tested the bucket and smaller files work.

Thanks


Solution

  • You have to use --recursive option to upload a folder:

    aws s3 cp --recursive “D:\WindowsImageBackup” s3://ad-backup/
    

    Or pack that folder into a single file and upload that file with plain aws s3 cp.