Uploading file to S3 bucket

I am trying to upload file from my local machine to S3 bucket but I am getting an error "The user-provided path ~Downloads/index.png does not exist."

aws s3 cp ~Downloads/index.png s3://asdfbucketasdf/Temp/index_temp.png

File with name index does exists on my Downloads.

8

2 Answers

This answer might be helpful to some users new to AWS CLI on different platforms.

If you are on Linux or Linux-like systems, you can type:

aws s3 cp ~/Downloads/index.png s3://asdfbucketasdf/Temp/index_temp.png

Note that ~Downloads means a username called Downloads. What you would want is ~/Downloads, which means Downloads directory under current user's home directory.

You can type out your path fully like so (assuming your home directory was /home/matt):

aws s3 cp /home/matt/Downloads/index.png s3://asdfbucketasdf/Temp/index_temp.png

If you are on Windows, you can type:

aws s3 cp C:\Users\matt\Downloads\index.png s3://asdfbucketasdf/Temp/index_temp.png

or you can use ~ like feature in Windows:

aws s3 cp %USERPROFILE%\Downloads\index.png s3://asdfbucketasdf/Temp/index_temp.png

If you are using windows and CLI version 2:

aws s3 cp "helloworld.txt" s3://testbucket

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like