@zedtech/zedkit-storage
Sanitise keys and presign uploads
Block `..` and control characters; optional `keyPrefix` from config.
alpha
Usage
At a glance
- Who: Handlers that accept user filenames and return short-lived upload URLs.
- What: Block
..and control characters; optionalkeyPrefixfrom config. - Use when: Direct-to-storage uploads from the browser or mobile app.
- Avoid when: Public anonymous buckets without presigning — configure IAM separately.
Install
pnpm add @zedtech/zedkit-storageLatest: 0.1.0 (via changesets).
Example
import { presignPutUrl, sanitizeFilename } from "@zedtech/zedkit-storage";
const safe = sanitizeFilename(userName);
await presignPutUrl(client, config, { key: `${userId}/${safe}`, contentType: "image/png" });Wraps: @aws-sdk/s3-request-presigner (peer)