CS3 Raw drops: shares, public links, garbage collection, file versions, arbitrary metadata, workflows, and space management. Those can be added via sidecar services. 5.1 Server (Python + FastAPI + local filesystem) from fastapi import FastAPI, Header, HTTPException from pathlib import Path import os, json, time app = FastAPI() ROOT = Path("/var/cs3raw")
All example code and a reference Docker image are available at: [hypothetical repository: github.com/cs3/raw]
@app.put("/data") def write(ref: str, request: Request, if_none_match: str = Header(None)): path = resolve_ref(ref) if if_none_match == "*" and path.exists(): raise HTTPException(412, "File exists") path.parent.mkdir(parents=True, exist_ok=True) with path.open("wb") as f: f.write(request.stream()) return "status": "ok"
GET /stat?ref=id:123e4567-e89b-12d3-a456-426614174000 :
| CS3 Raw | Standard CS3 (gRPC) | |--------------------|-------------------------------------| | stat | Stat() | | read | InitiateDownload() + stream | | write | InitiateUpload() + stream | | delete | Delete() | | list | ListContainerStream() | | Bearer token | Opaque token in Authorization | | ref=path:/... | ReferencePath: ... | | ref=id:... | ReferenceResourceId: ... |
"entries": [ "name": "notes.txt", "size": 1024, "etag": "\"abc123\"", "type": "file", "name": "pics", "type": "directory" ]
def resolve_ref(ref: str) -> Path: if ref.startswith("path:"): return ROOT / ref[5:] raise HTTPException(400, "Only path: references supported")
CS3 Raw drops: shares, public links, garbage collection, file versions, arbitrary metadata, workflows, and space management. Those can be added via sidecar services. 5.1 Server (Python + FastAPI + local filesystem) from fastapi import FastAPI, Header, HTTPException from pathlib import Path import os, json, time app = FastAPI() ROOT = Path("/var/cs3raw")
All example code and a reference Docker image are available at: [hypothetical repository: github.com/cs3/raw] cs3 raw
@app.put("/data") def write(ref: str, request: Request, if_none_match: str = Header(None)): path = resolve_ref(ref) if if_none_match == "*" and path.exists(): raise HTTPException(412, "File exists") path.parent.mkdir(parents=True, exist_ok=True) with path.open("wb") as f: f.write(request.stream()) return "status": "ok" CS3 Raw drops: shares, public links, garbage collection,
GET /stat?ref=id:123e4567-e89b-12d3-a456-426614174000 : | ReferencePath:
| CS3 Raw | Standard CS3 (gRPC) | |--------------------|-------------------------------------| | stat | Stat() | | read | InitiateDownload() + stream | | write | InitiateUpload() + stream | | delete | Delete() | | list | ListContainerStream() | | Bearer token | Opaque token in Authorization | | ref=path:/... | ReferencePath: ... | | ref=id:... | ReferenceResourceId: ... |
"entries": [ "name": "notes.txt", "size": 1024, "etag": "\"abc123\"", "type": "file", "name": "pics", "type": "directory" ]
def resolve_ref(ref: str) -> Path: if ref.startswith("path:"): return ROOT / ref[5:] raise HTTPException(400, "Only path: references supported")
Copyright © 2026 Pacific Epic Palette