Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

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 SystemSource (Tomcat)Target (Directory)
Linux<path>/tomcat/webapps/phixflow/datalink

<path>/phixflow/data/datalink/

Windows<path>\tomcat\webapps\phixflow\datalink<path>/phixflow/data/datalink/

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.

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

  1. Create a new screen
  2. Open the palette and add one of the Complete Screens to the screen by dragging and dropping it.
  3. Open the table containing the names of the customer logo e.g. Businesses
  4. Drag the attribute containing the logo name onto the screen e.g. LogoName.
  5. Setting the background image
    1. In the palette find the Area component and drag it onto the screen.
    2. Navigate to its Style Tab and set the following:
      1. Background Repeat: no-repeat
      2. Background Size:      100%
        1. See Image Sizing for more information on this.
    3. In the CSS Properties section, click the add button and set the following:
      1. CSS Tag: background-Image
      2.  Value: "datalink/customerImages"+_form.LogoName
        1. If you are obtaining the logo name from an attribute on a grid or card component, these can be referenced using:
        2. Grid: _selected. AttributeName
        3. Card Component: _current.AttributeName
      3. Expression: Tick
    4. Save all changes
  6. The image should now display inside the Area component.