type

UploadInput

File bytes and application-owned metadata for one upload.

Properties

PropertyTypeDescription
FilenamestringOriginal client-supplied file name.
Readerio.ReaderStream providing the uploaded bytes.
Image*UploadImageEditImage stages a crop and focal point with the document mutation.
Draft*boolDraft selects working (true) or published (false) content on creation.
Datastore.ValuesApplication-owned fields for the upload document.
Actor*store.DocumentAuthenticated actor evaluated by access rules.
ActorCollectionschema.CollectionSlugExact auth collection that owns Actor.
LocaleLocaleOptionsContent locale for application-owned upload metadata.

How it works

Bytes, metadata, access, validation, hooks, storage, and document persistence run through one upload operation. The caller retains ownership of Reader.

Full signature

type UploadInput struct { // Filename is the original client-supplied file name. Filename string // Reader provides the uploaded bytes. Reader io.Reader // Image stages a crop and focal point with the document mutation. Image *UploadImageEdit // Draft selects working (true) or published (false) content on creation. Draft *bool // Data contains application-owned upload document fields. Data store.Values // Actor is the authenticated document used by access rules. Actor *store.Document // ActorCollection identifies the exact auth collection that owns Actor. ActorCollection schema.CollectionSlug // Locale selects the content locale for application-owned upload metadata. Locale LocaleOptions }

Source core/uploads.go:29