Skip to main content

AWS CLI Examples

You can configure the AWS CLI to connect to Files.com using a custom endpoint:

aws configure

When prompted, enter your Files.com Access Key ID for AWS Access Key ID, your Files.com Secret Access Key for AWS Secret Access Key, and us-east-1 for Region.

Then run:

# path-style:
aws s3 ls --endpoint-url https://s3-mysite.files.com

# path-style and virtual-hosted-style:
aws s3 ls --endpoint-url https://s3.files.com

The same endpoint settings work with any S3-compatible tool or library.

Uploading, Downloading, and Managing Objects

Files.com supports standard S3 object operations for uploading, retrieving, listing, and deleting files.

Upload an Object

# path-style:
aws s3 cp /path/to/myfile.txt s3://default/destinationfolder/myfile.txt --endpoint-url https://s3.files.com

# virtual-hosted-style:
aws s3 cp /path/to/myfile.txt s3://mysite/destinationfolder/myfile.txt --endpoint-url https://s3.files.com

Download an Object

# path-style:
aws s3 cp s3://default/folder/myfile.txt /downloads/myfile.txt --endpoint-url https://s3.files.com

# virtual-hosted-style:
aws s3 cp s3://mysite/folder/myfile.txt /downloads/myfile.txt --endpoint-url https://s3.files.com

List Objects

# path-style:
aws s3 ls s3://default/ --endpoint-url https://s3.files.com

# virtual-hosted-style:
aws s3 ls s3://mysite/ --endpoint-url https://s3.files.com

Delete an Object

# path-style:
aws s3 rm s3://default/folder/myfile.txt --endpoint-url https://s3.files.com

# virtual-hosted-style:
aws s3 rm s3://mysite/folder/myfile.txt --endpoint-url https://s3.files.com