Skip to main content

How uploading works

ModelRoute handles file uploads with zero trust. You send the raw file bytes, and ModelRoute:
  • Detects the content type from file magic bytes (never trusts client-declared MIME types)
  • Generates a UUID filename (original filenames are never stored or exposed)
  • Verifies the actual file size from the uploaded bytes (declared sizes are always overridden)
  • Streams the upload to storage without buffering the entire file in memory
You never need to tell ModelRoute what your file is. ModelRoute figures it out from the bytes.

Step 1: Request a presigned upload URL

Request body

Response

Step 2: Upload the file

Use an HTTP PUT request to upload the raw file bytes to the presigned URL:
ModelRoute detects the file type from the first bytes of the uploaded content. You do not need to set a Content-Type header on the PUT request. If you do set one, ModelRoute will override it with the server-detected type.

Step 3: Confirm the upload

After the PUT completes, confirm the upload so ModelRoute can verify the file in storage:
ModelRoute will:
  • Verify the file exists in storage
  • Read the actual file size from storage (not from any client-declared value)
  • Detect the content type from the file bytes
  • Generate a compliance clone for audit purposes
  • Return the confirmed file metadata

Confirm response

Step 4: Use the file reference

Pass the file_id in your execution input:

Security model

ModelRoute follows a zero-trust approach to file handling:

Error handling

Complete upload flow example