Build Your Workspace
Media & Uploads
File uploads, asset management, and the upload field.
QUESTPIE handles file uploads through the upload field type and a configurable storage backend.
Upload Field
avatar: f.upload({
to: "assets", // Upload collection name
mimeTypes: ["image/*"], // Allowed MIME types
maxSize: 5_000_000, // Max file size (5MB)
}),
coverImage: f.upload({
to: "assets",
mimeTypes: ["image/jpeg", "image/png", "image/webp"],
maxSize: 10_000_000,
}),Upload Options
| Option | Type | Description |
|---|---|---|
to | string | Target upload collection (e.g., "assets") |
mimeTypes | string[] | Allowed MIME types (supports wildcards) |
maxSize | number | Max file size in bytes |
Admin UI
In the admin panel, upload fields render:
- Drag-and-drop area for file upload
- Preview for images
- File info (name, size, type)
- Remove button
Storage Configuration
Configure the storage backend in your runtime config:
questpie.config.ts
export default runtimeConfig({
storage: {
basePath: "/api",
},
// ...
});See Storage for S3, local, and other backends.
Admin Metadata
Customize the upload field appearance:
avatar: f.upload({
to: "assets",
mimeTypes: ["image/*"],
meta: {
admin: {
accept: "image/*",
previewVariant: "compact",
},
},
}),