Files
Stryke supports attaching files to records. In order to do so, the entity must be configured to allow files. In order to do that, go to the entity definition and set the canHaveFiles property to true:
Once setup, files will appear on the relevant records under the app's UI.
Files component
The files component allows you to view, upload and download the files attached to a record.
Uploading files
To upload a file, click the "Upload" button on the component and select the desired file.
After the file is uploaded you will get a confirmation message.
The files attached to a specific record must have unique names. This means that uploading a file to a record that already has a file with the same name will override its the content.
Preview files
Clicking any row of the component allows you to preview that file.
The table below lists the formats supported for preview within the app's UI.
File Type | Mime Type |
---|---|
application/pdf | |
Text | text/plain |
JSON | application/json |
Image | image/jpg |
Image | image/jpeg |
Image | image/png |
Image | image/gif |
Video | video/mp4 |
Audio | audio/mp3 |
Audio | audio/x-m4a |
Other | Any other mime type |
Note that the preview is only supported for some file types, but files of those types can still be uploaded/downloaded normally.
Download files
Clicking the download button allows you to download the file to your machine.
Files API
You can interact with your app's files also using the Stryke API. Files are related to individual data records via an object called FileMedata
.
The FileMetadata API allows generating pre-signed download and upload URLs for your files.