The File Upload 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.
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.
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.
- Choose 'Connect bucket'
- Take note of the bucket suffix that your bucket must use which is displayed in the connection modal at the top.
- In your AWS account create a new S3 bucket that uses the provided suffix in the bucket name.
- Back in Atomic provide the bucket name and AWS region and copy the provided bucket policy.
- Select 'Connect'.
- 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)
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.
After the "Wait for image upload" step add another "Send card" step.
In the card for this step:
- Add an image element.
- Choose "External URL" as the image source.
- In the "URL" input click the context-picker icon, or type "+"
- Search for "uploaded file path" and select this option.
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.