QUESTPIE
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

OptionTypeDescription
tostringTarget upload collection (e.g., "assets")
mimeTypesstring[]Allowed MIME types (supports wildcards)
maxSizenumberMax 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",
    },
  },
}),

On this page