Overview
Users can upload their own files into PhixFlow using actions. This can be done using either a
Insert excerpt |
---|
| _action |
---|
| _action |
---|
nopanel | true |
---|
|
which links to a
Insert excerpt |
---|
| _file_collector |
---|
| _file_collector |
---|
nopanel | true |
---|
|
, or an
Insert excerpt |
---|
| _actionflow |
---|
| _actionflow |
---|
nopanel | true |
---|
|
containing a file upload node. This will allow users to
:- Upload images/files and store the details of where to access them as a record.
- Upload files to be used in an analysis model. These files can be made available for users to download.
Example
In a simple contacts application, it is possible using file uploads to:
- Allow an application user to upload their own image against a contact:
Image Modified
- Bulk upload Excel files containing multiple contacts to appear within an application.
- Download files stored on the server. These could be previous file uploads.
Solution
Images and files are stored on the server when uploaded by a file collector. These files are placed into a standard directory and need to be moved into an appropriate directory which can be accessed by the front end. See your system administrator for help creating these directories.
Once the new directory has been created, the following is required:
- an action configured to upload a file
- an analysis model containing a file collector and a table
- a task plan that runs the analysis model
This is a worked example to set up a model that collects an uploaded file, moves it, and all the upload subdirectories, to the required new directory using an archive location on a file collector, to tell the collector where to move the file once it has been processed.
When files are uploaded via an action, they are initially stored under the default upload directory, this is specified in your system configuration. For example:
Code Block |
---|
/opt/phixflow/data/phixflow/upload |
A subdirectory is created for each uploaded file, in the form:
Code Block |
---|
/opt/phixflow/data/phixflow/upload/[tag]/in/[uploadDate]/[uploadID]/[filename] |
where
- [tag] is the tag specified by the action or file collector,
- [uploadDate] is the date of upload represented in a numerical string,
- [uploadID] is a unique string used to identify each file, and
- [filename] is the name of the uploaded file.
When uploading files through the front end , we aim to move the files to a location under (either directly or via soft link) the below directory while preserving these subdirectories in order to uniquely reference each file.
Code Block |
---|
/opt/phixflow/data/phixflow/datalink |
1. Creating the
action Action to
upload Upload a
fileFile
- In the File Upload section, tick File Upload and enter a Tag Expression (e.g. "contact").
- The exact tag used does not matter but needs to be used later to reference the upload location.
- Ticking File Upload means that running the action will trigger a file upload prompt, allowing the user to select a file to upload
.- :
2. Creating the Analysis Model
- Create a new analysis model and create a
Insert excerpt |
---|
| _file_collector |
---|
| _file_collector |
---|
nopanel | true |
---|
|
. Apply the following settings: