Skip to main content

S3 file uploader

The S3 file uploader component allows you to upload files to an S3 bucket.

s3fileupload

The following section details S3 file uploader component's specific settings. For more details on the App editor, check the dedicated documentation or the App editor Quickstart:

Controls

This component can be controlled by frontend scripts using these functions:

NameParametersDescriptionExample
clearFilesid: stringClear the files of a file input.clearFiles(id: 'a')

Interactions

The S3 file uploader component offers the following interactions:

  • Files are uploaded in chunks to the S3 bucket. The component emits the file path in the S3 bucket upon completion of the upload.
  • The upload can be canceled by clicking on the 'Cancel' button.
  • All uploads can be canceled simultaneously by clicking on the 'Cancel All' button.
  • After completing all uploads, more files can be uploaded by clicking on the 'Upload More' button.
  • Uploaded files can be deleted by clicking on the 'Delete' button.

Inputs

TypeTypeConnectableTemplatableDefaultDescription
resourceS3 ResourcetruefalseIt defaults to the workspace S3 resource if it exists.The S3 resource to use to upload the file.
Accepted File Typesarrayfalsefalse"image/*" ; "application/pdf"The types of files you accept to be submitted.
Allow MultiplebooleanfalsefalsefalseIf allowed, the user will be able to select more than one file
TextstringfalsefalseDrag and drop files or click to select themThe text displayed on the file input.
Path templatestringfalsefalse${file.name}The path template to use to upload the file.
DisabledbooleanfalsefalsefalseThe state of the file input.

Outputs

NameTypeDescription
resultArrayAn array containing the paths of the uploaded files.
loadingbooleanThe loading state of the S3 file uploader component.

Event handler

The modal component has the following event handler:

  • onFileChange: Trigger one or more runnables when the user uploads a file.