Working with Files and Media
Last updated
Was this helpful?
Last updated
Was this helpful?
Airkit handles files and media in two ways on that is part of the application and shared across all users and the other is stored within a particular user's journey.
App Assets are files & media that are included in the application itself and can be referenced through the Studio when designing an experience. Examples Include:
Images in a web experience (PNG, JPG, etc.)
Documents to download (PDFs, ZIP etc.)
Or other media such as videos (MP4)
These assets need to be included in your and are made available through special URLs that resolve securely to a user through your custom domain and quickly as through the Airkit CDN.
.png)
Journey Assets are files that are associated with a specific user's journey within Airkit and can be stored within variables and used within data operations. Some common examples include:
from a customers mobile device
from a customer
(PNG)
(Form fills, merged PDFs or custom generated)
Once a file has been uploaded into your Media Library you now have an Asset URI to use to reference the file while building your app.
You may notice that the way Airkit refers to files is not a typical URL and isn't able to be retrieved outside of the Airkit platform. There are two primary reasons for using a specific URI
Security - these Asset URIs can only be accessed in the context of an Airkit operation such as within a journey of a user and are dynamically exchanged for temporary URL
Version Control - we want to make sure that files are tracked across versions of applications easily and caching issues do not arise
asset://[Access Scope]:[Organization UUID]/[Application UUID]:[File UUID]:[Version Number]
Access Scope: Global or user specific
Organization UUID: Your Organizations ID
Application UUID: The specific branch of the application that is serving the asset. This is used for version control so that asset links will still function for journeys that started on an older branch of your application
File UUID: Uniquely represents the file within your application's Media Library
Version Number: An auto-incrementing version number of an asset
There are quite a few Data Operation that either produce files or consume files to perform their actions and all of these functions leverage the Asset variable type to provide or pass around references to the underlying files. For example:
Because Journey Assets are stored in variables the scope of how long they are available is determined by whether the Journey is active or expired, please see for more information.
The Asset data type of a variable allows you to work with files and media within a journey using and within .
Some examples of when you might use a variable with the to receive or handle a file
The web control to receive photos from a mobile device's camera or photo library
The web control to receive files from a mobile device or desktop
The web control to capture a users hand-written e-signature
Creating a new PDF from an HTML template with user specific values using the Data Operation
Filling the fields of a form-fillable PDF template with user specific values using
Merging the pages of multiple PDFs together using
Generating a flat file from journey or batch data using
Combining and compressing multiple files together with
Sending files as attachments on emails with
Sending files securely with
Looking up file meta information with
Deleting one or more Assets with
Getting a temporary download URL to share with a user with
Using you can upload assets to be included and referenced in your application
Inserting Images using the
produces any file type and inserts content such as TXT, JSON, XML, CSV, TSV
takes a blank PDF template and merges values into form field to produce a filled PDF
creates a custom PDF using HTML for layout, styling and allowing full control over data and dynamic content including inserting images, CSS, footers/headers, page breaks and more
provides an operation to combine the pages of multiple PDF files into one PDF
provides an operation to combine and compress multiple files into a single ZIP file
allows to attach one or more files to an outbound email originated from Airkit
allows sending a file securely over FTP to remote server
given an Asset URI looks up file details such as (name, type, size) and provides a temporary URL to download the underlying file
removes the underlying file(s) from the server for an asset