Skip to main content

Quickstart - SDK

Choose your language and follow along. Each example uploads a file and verifies it. Create the bucket first in the dashboard — CreateBucket over the S3 API is not available in eu-west-1, the default region these examples use.

The endpoint depends on your bucket's region

These examples use eu-west-1, the default region. For a bucket in us-east-1, use https://s3.us-east-1.filonecontent.com and region us-east-1. The endpoint, the region, and your access key must all refer to the same region.

Each example reads your key from the standard AWS environment variables, the same names the console's Download .env writes. Set them in your shell before you run an example, and keep the secret out of your code:

export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY

The Python and JavaScript examples upload my-file.txt, so create it first: echo "hello" > my-file.txt.

pip install boto3
import boto3
from botocore.config import Config

s3 = boto3.client(
"s3",
endpoint_url="https://s3.eu-west-1.filonecontent.com",
region_name="eu-west-1",
# Credentials come from AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY
config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

# Upload a file (create the bucket first in the dashboard)
s3.upload_file("my-file.txt", "my-bucket", "my-file.txt")

# Verify
response = s3.list_objects_v2(Bucket="my-bucket")
for obj in response.get("Contents", []):
print(f"{obj['Key']} ({obj['Size']} bytes)")

For more detailed examples including multipart uploads and presigned URLs, see the dedicated SDK pages: