Skip to main content

The File Upload feature

Beta & Premium feature

This feature is currently in beta. This feature may not be available to all organizations. Please contact us to provide feedback or to have this feature enabled in your organization.

Adding a File Upload element to a card

Note: SDK version 24.3.0-beta1 or higher is required to use this feature.

Cards created in the Action Flows editor have a new element available - File upload.

An image showing the selection of the File Upload element when adding to a card

When selected a new input element is added to the card where a user can upload a file, this file is not sent to Atomic until the card is completed, so a submit button must also be added.

An image showing the minimum required configuration in a card to use a file upload element

Settings for the File Upload element

The File Upload element has the following attributes that can be configured in the workbench.

File type

The allowed file types for the upload. Currently only images are supported, other file types will be supported in the future.

File size

The maximum file size that can be provided, the Atomic platform has a hard limit of 128mb. You can also configure a custom message to show to users if the file they try to upload exceeds your limit.

Required

Whether or not the file upload must be completed before the card can be submitted/completed. An accompanying message can also be provided here if they user tries to submit the card without first providing a file.

Thumbnail placeholder

Display a thumbnail placeholder image before an image is uploaded.

File destination

Where the file should be sent after uploading. By default this is Atomic's "Test S3 bucket". You can configure your own AWS S3 buckets as file destinations. See Configuring a destination bucket for more info.

Configuring a destination bucket

By default, files are uploaded to Atomic's test bucket. For production use we recommend configuring your own AWS S3 bucket instead of using the default. The default bucket will permanently delete any files 7 days after the initial upload.

Configuring your own AWS S3 bucket

In the Atomic Workbench under Configuration > Integrations > AWS > AWS S3 buckets for use by Atomic Action Flows you can connect your S3 buckets to be used as a destination for uploaded files.

  1. Choose 'Connect bucket'
  2. Take note of the bucket suffix that your bucket must use which is displayed in the connection modal at the top.
  3. In your AWS account create a new S3 bucket that uses the provided suffix in the bucket name.
  4. Back in Atomic provide the bucket name and AWS region and copy the provided bucket policy.
  5. Select 'Connect'.
  6. Back in AWS:
    • select your bucket
    • go to the 'Permissions' tab
    • edit your bucket policy to use the copied policy from Atomic (plus any additional permissions you may wish to implement)
Bucket permissions

Adding the bucket policy from Atomic gives the Atomic system access to read and write to your AWS S3 bucket. If you do not wish to use uploaded files in follow-on cards in your Action Flows then you can omit the s3:GetObject permissions and Atomic will be unable to read files from your bucket.

Once you have connected a bucket you can select it as your File destination in the Action Flows card editor.

Using an uploaded file in a follow-on card

In an Action Flow it is possible to use a file uploaded from one card in another card.

After your "Send card" step of the card which includes the file upload add a card-complete event listener step, as a child of that step add a "Wait for image upload" step.

An image showing the addition of a 'Wait for image upload' step

After the "Wait for image upload" step add another "Send card" step.

In the card for this step:

  1. Add an image element.
  2. Choose "External URL" as the image source.
  3. In the "URL" input click the context-picker icon, or type "+"
  4. Search for "uploaded file path" and select this option.
An image showing the context option to choose for an uploaded file
Pre-signed URLs

When an uploaded file is used in a follow-on card in this manner Atomic generates a presigned URL that is used to display the file. This URL is publicly available though heavily obfuscated making it near impossible to guess.

This generated link is valid for 2 weeks from the point that the card is sent, after that point the image will stop rendering in the card.

Virus scanning

Atomic performs a virus scan on all uploaded files and will reject any files that fail this virus scan. This virus scan can be a somewhat slow process. At best performance you can expect at least a 15 second wait while the file is scanned. When there are many uploads sent to Atomic at once there can be delays on the scanning and therefore delays on follow-up cards that use the uploaded images or delays in sending the files to your AWS S3 buckets.

To best handle the file scanning process we suggest the following set-up in your Action Flows that use uploaded content in follow-on cards.

After your "Send card" step with the file upload add listeners for the following events

  • card-completed
  • file-scan-failed

After the file-scan-failed listener send a card explaining that the uploaded image failed to pass virus scanning, you may like to provide another file upload attempt here or other remediation.

After the card-completed listener immediately send a card explaining that the file has been received and is being processed, you may wish to add a short relative expiry on this card so it doesn't stick around too long.

After the card-completed listener add the file-scan-completed listener as per using an uploaded file in a follow-on card and continue your Action Flow as desired.

An image showing the recommended steps to handle a file upload in an Action Flow