File upload v2.28.0

File uploads can be designed in many different ways. For this example we want to upload one file for each row and have some visual feedback for its status. A download should be possible as well.
Prerequisites
- Connected file system
- API Key for the file folder (in this example we will use the folder ‘test’)
- Data+ Table with the following setup
- ID column
- Text field column ‘file path’ (display hidden)
- Button ‘Upload’ with action Cell file upload
- Button ‘File’

Basic functionality
-
create a rule for the upload
The upload button action Cell file upload will open the default upload dialog. Once a file has been selected, this rule will be triggered and we have access to the file.-
Our file path
test/$(ID).txtconsists of the fixed folder ‘test’, the row ID (Rule values) and the file type ‘.txt’- Optionally, we could check for the correct file type of the uploaded file in the condition
-
The File->Data settings can be any text or in this case the uploaded file content

-
We could add further actions to this rule, but in this case we want to make sure the upload was successful before we do anything else
-
-
Once an upload has been completed, the API result triggers are executed
-
Our next rule will check for a successful request and save the used file path to the database

-
The download rule looks like quite similiar to the upload

-
We have a working upload/download functionality now

Visual feedback
-
It is possible to click the download in a row, even if no file has been uploaded. Therefore, hiding or disabling the download button might be a good idea.

-
Additionally, we could add some sort of file confirmation handling

-
Once a row has been confirmed, this rule will disable the upload and change the download button color
