This page is for application designers who need the ability to download files and/or access them programmatically.
Within your application screens, you may use images and files that have been uploaded onto the PhixFlow server. For example,
- allowing users to download a file.
- displaying an image based on expression logic. For example, display a user image based on the logged in user.
Your administrator should have configured the Tomcat webserver to see specific directories by creating soft links from a source to a target. See Install the PhixFlow Webapp. Strictly speaking this is an optional step, but it part of the recommended installation for PhixFlow. If you are not sure, please talk to your system administrator.
For example:
To access the files use the soft link:
- To create a download, create an action which opens the URL: "datalink/MyData.xlsx"
Note, not all file types will invoke a download, for example a PDF will simply open in a new browser tab.
- For display, an image or PDF can be embedded in a URL component using the value: url("https:datalink/Snapshot.jpg")
- For display, images can be applied to areas by setting the CSS property background-image to: "datalink/Snapshot.jpg"
Example Setup for Images using a Soft Link
This example covers the scenario where a user has a set of logos and needs PhixFlow to display them based on the Business currently selected.
Step1: Setup the soft link
See Configuring Soft Links Between PhixFlow and Tomcat for the commands
Example locations are shown below:
Operating System | Source (Tomcat) | Target (Directory) |
---|---|---|
Linux | <path>/tomcat/webapps/phixflow/datalink |
|
Windows | <path>\tomcat\webapps\phixflow\ | <path>/phixflow/ |
Step 2: Upload Images
The business logos should be uploaded onto the server into the Target directory using the appropriate protocol e.g. FTP.
It should be noted it is a good idea to create subdirectories under the Target directory for different types of information i.e. "customImages" for the customer logos we are uploading.
In this example we will upload our images to: <path>/phixflow/data/datalink/customImages.
Step 3: Display an Images
Anchor | ||||
---|---|---|---|---|
|
It is assumed that a table exists which contains the names of the Business logos. For example a Businesses table with an attribute called LogoName that holds the name of the business's logo.
Setup
- Create a new screen
- Open the palette and add one of the Complete Screens to the screen by dragging and dropping it.
- Open the table containing the names of the customer logo e.g. Businesses
- Drag the attribute containing the logo name onto the screen e.g. LogoName.
- Setting the background image
- In the palette find the Area component and drag it onto the screen.
- Navigate to its Style Tab and set the following:
- Background Repeat: no-repeat
- Background Size: 100%
- See Image Sizing for more information on this.
- In the CSS Properties section, click the add button and set the following:
- CSS Tag: background-Image
- Value: "datalink/customerImages"+_form.LogoName
- If you are obtaining the logo name from an attribute on a grid or card component, these can be referenced using:
- Grid: _selected. AttributeName
- Card Component: _current.AttributeName
- Expression: Tick
- Save all changes
- The image should now display inside the Area component.