user380696
user380696

Reputation: 111

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.

Upvotes: 3

Views: 15991

Answers (2)

Ahmad Kefaye
Ahmad Kefaye

Reputation: 1

If you are using windows and CLI version 2:

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

Upvotes: 0

zedfoxus
zedfoxus

Reputation: 37119

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

Upvotes: 5

Related Questions