Skip to main content

Uploads

All upload fields automatically upload files to S3 and save url to given field. If file has more parameters (such as size, type, width, etc.) they will be saved too.

Any file repeater

The AnyFileRepeater component renders a repeater field for uploading any file.

Loading...

Any upload field

The AnyUploadField component renders a file upload field for uploading any file.

Loading...

Props

PropDescription

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

Audio file repeater

The AudioFileRepeater component renders a file repeater field for uploading audio files.

<ImageFileRepeater
field="songs"
urlField="song.url"
label="Album"
sortableBy="order"
/>

Props

PropDescription

field

string

The name of the column in Contember schema where to store data.

Required

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

sortableBy

undefined | string

The name of the column in Contember schema that is used to sort the options.

orderBy

undefined | string

The name of the column in Contember schema that is used to order the options.

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

heightField

undefined | string

The name of the column in Contember schema where to store height.

widthField

undefined | string

The name of the column in Contember schema where to store width.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

Audio upload field

The AudioUploadField component renders a file upload field for uploading audio files.

Loading...

Props

PropDescription

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

Image file repeater

The ImageFileRepeater component renders a file repeater for uploading image files.

<ImageFileRepeater
field="images"
urlField="image.url"
label="Gallery"
sortableBy="order"
/>

Props

PropDescription

field

string

The name of the column in Contember schema where to store data.

Required

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

sortableBy

undefined | string

The name of the column in Contember schema that is used to sort the options.

orderBy

undefined | string

The name of the column in Contember schema that is used to order the options.

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

heightField

undefined | string

The name of the column in Contember schema where to store height.

widthField

undefined | string

The name of the column in Contember schema where to store width.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

Image upload field

The ImageUploadField component renders a file upload field for uploading image files.

Loading...

Props

PropDescription

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

heightField

undefined | string

The name of the column in Contember schema where to store height.

widthField

undefined | string

The name of the column in Contember schema where to store width.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

renderFilePreview

(options: RenderFilePreviewOptions) => ReactNode

Renders the file preview.

Video file repeater

The VideoFileRepeater component renders a file repeater for uploading video files.

<VideoFileRepeater
field="videos"
urlField="video.url"
label="Video serie"
sortableBy="order"
/>

Props

PropDescription

field

string

The name of the column in Contember schema where to store data.

Required

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

sortableBy

undefined | string

The name of the column in Contember schema that is used to sort the options.

orderBy

undefined | string

The name of the column in Contember schema that is used to order the options.

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.

Video upload field

The VideoUploadField component renders a file upload field for uploading video files.

Loading...

Props

PropDescription

urlField

string

The name of the column in Contember schema where to store file url.

Required

label

ReactNode

The label for the field.

Required

description

ReactNode

The description for the field.

fileNameField

undefined | string

The name of the column in Contember schema where to store file name.

fileSizeField

undefined | string

The name of the column in Contember schema where to store file size.

fileTypeField

undefined | string

The name of the column in Contember schema where to store file type.

heightField

undefined | string

The name of the column in Contember schema where to store height.

widthField

undefined | string

The name of the column in Contember schema where to store width.

enableAddingNew

undefined | boolean = true

If true, the field allows adding new options.

acceptFile

undefined | ((options: AcceptFileOptions) => boolean | Promise)

A function that is called to check if the file is accepted.

acceptMimeTypes

undefined | string | string[]

Accepted mime types.