Upload an object with an S3 client

Upload a small object through the Dosya S3 endpoint, interpret the returned ETag, and verify its key, byte size, and overwrite behavior safely.

Last reviewed

A Dosya S3 PutObject writes to bucket {workspace-id} at the configured key. Missing prefix segments can become folders when the member role permits folder creation; uploading to an existing file key creates a new Dosya version.

Four-step workflow map for Upload an object with an S3 client: Record the test file size and object key, choose an overwrite-safe destination. Upload once with secrets outside shell history, address the bucket by workspace ID. Require HTTP 200 from PutObject, retain the returned ETag as the receipt. Issue HEAD for the same key, compare the stored size and ETag.
This map follows upload an object with an s3 client from “Record the test file size and object key, choose an overwrite-safe destination.” through “Upload once with secrets outside shell history, address the bucket by workspace ID.” and “Require HTTP 200 from PutObject, retain the returned ETag as the receipt.”, ending with “Issue HEAD for the same key, compare the stored size and ETag.”. Open full-size screenshot.

Before you start

Use endpoint https://api.dosya.dev/s3, region us-east-1, path-style addressing, and an S3 credential with upload or full scope. The member role must allow S3 and uploads.

Start with a disposable object below 50 MB. Plain requests require a valid Content-Length; clients may instead use supported AWS chunked framing. Workspace extension policy, per-file limits, credential or role limits, quota, hidden paths, and folder locks all remain active.

Steps

  1. Create a small local test file and record its exact byte size and destination key, including case and every prefix segment.
  2. Confirm the bucket is the workspace ID and the key sits inside any folder anchor assigned to the credential.
  3. Upload once with the client’s put, cp, or PutObject command while keeping credentials outside command history.
  4. Require an HTTP 200 response and save the returned ETag; a checksum header is echoed only after Dosya verifies it.
  5. Issue HEAD or a permitted listing for the same key and compare the reported size and stored ETag with the upload result.
  6. Open the destination in Dosya and confirm one file exists; if you intentionally upload the same key again, verify that its version number advances.
Reference for “Upload an object with an S3 client”: Dosya S3-compatible access overview page.
Reference for “Upload an object with an S3 client”: Dosya S3-compatible access overview page. Open full-size screenshot.

Expected result

The object is stored once at the requested key with the expected bytes. New nested prefixes create folders only when allowed, and an overwrite preserves history as a new file version rather than creating a second same-name row.

Exact refusals identify the gate: API key scope ‘read’ cannot upload files, Upload not allowed, Creating folders is not allowed, Destination folder is locked, Object is locked, QuotaExceeded, or EntityTooLarge. Correct that gate before retrying.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.