Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
namescreen
nopaneltrue

Introduction

The File Display Gallery component is used to facilitate the uploading and displaying of multiple files in PhixFlow. Files are previewed and where this is not possible, a generic placeholder image is displayed. The Serene Grey palette provides a number of templates, below is an example of the File Display Gallery form field.

File Display Gallery components require the following key items in order to function:

  1. A directory on the server to store the uploaded files and an entry in the
    Insert excerpt
    _system_config
    _system_config
    namefull
    nopaneltrue
     to point at this location
  2. A special type of table called a
    Insert excerpt
    _tableFile
    _tableFile
    nopaneltrue
    to hold the information about the uploaded files
    1. This is added using an ERD
  3. A
    Insert excerpt
    _tables
    _tables
    nopaneltrue
    containing an attribute called folderId and of type, string, that is related to the above
    Insert excerpt
    _tableFile
    _tableFile
    nopaneltrue
    via this attribute
    1. This is added using an ERD

Initial Setup

In order to store an uploaded file the following must be completed.

  1. Directory
    1. On your server, create a directory where the files will be uploaded. This should be accessible to the application
    2. In PhixFlow, from the
      Insert excerpt
      _administration
      _administration
      nopaneltrue
       menu, open System → 
      Insert excerpt
      _system_config
      _system_config
      nopaneltrue
    1. In the System Directories section → File Table Upload Location field, add the address of the directory setup in the first step, e.g. /opt/phixflow/data/file
    2. Insert excerpt
      _save_icon
      _save_icon
      nopaneltrue
       save your changes
    3. All uploaded files will now be placed in this directory
  1. File Table
    1. On your ERD, add a new 
      Insert excerpt
      _tableFile
      _tableFile
      nopaneltrue
      1. All the required attributes are added by default and cannot be modified
  2. Table
    1. On your ERD, use an existing or add a new
      Insert excerpt
      _tables
      _tables
      nopaneltrue
      1. Create a new attribute:
        1. Name: folderId
        2. Type: String
    2. Create a Relationship from the folderId attribute on the
      Insert excerpt
      _tableFile
      _tableFile
      nopaneltrue
      to the folderId attribute on the 
      Insert excerpt
      _tables
      _tables
      nopaneltrue
    3. Data can now be saved directly to this table or via a relationship

Uploading Files

  1. Drag the File Display Gallery component from the Serene Grey palette onto your screen
    1. Expand
      titleView Serene Grey Template

      Serene Grey provides a number of templates that incorporate the File Display Gallery component, each designed to help you tackle a different task. 

      Form Fields - Defaults

      This File Display Gallery component is designed to sit inline with the other default form fields.

      Image Modified

      Basic Layouts

      The File Display Gallery is a component that provides the functionality of the file display gallery in its raw form ready to be added to a screen or your own design.

      Image Modified

  2. Add a backing attribute by clicking on the component until the properties for the inner component, File Display Gallery, displays on the right
    1. On the
      Insert excerpt
      _property_tabs
      _property_tabs
      nopaneltrue
      , in the Backing Attribute section, click the
      Insert excerpt
      _attributes_add_backing
      _attributes_add_backing
      nameicon
      nopaneltrue
      icon
    2. Select Choose the folderId attribute on your 
      Insert excerpt
      _tables
      _tables
      nopaneltrue
      1. For the full list of properties for the File Display Gallery component, see File Display Gallery Properties
  3. Ensure the File Display Gallery form field is added to your save actionflow, so the data is saved
  4. Now, with your screen
    Insert excerpt
    _lock
    _lock
    nopaneltrue
    ed you you can drag multiple files onto the File Display Gallery component to populate the data. This populates the fieldEnsure the File Display Gallery form field is added to your save actionflow, so the data is saveddata 

Image Added

Creating a Download Hyperlink

A text hyperlink can be created that facilitates the downloading of a file.

  1. On the screen that is backed by the required table, click
    Insert excerpt
    _attributes
    _attributes
    nopaneltrue
  2. Navigate to the File Table and drag the Url attribute onto your screen
  3. A hyperlink will be created that downloads the file associated to the current record, i.e. the file for the record currently on the form
    1. The hyperlink component is created using the template defined in the application's
      Insert excerpt
      _property_settings
      _property_settings
      nopaneltrue
       →
      Insert excerpt
      _property_tabs
      _property_tabs
      namestyle
      nopaneltrue
       → Default Components section → Default File Url Component  

Background Icons

The background icons for the

Further Reading

indicate the following:
  • When the File Display Gallery is available for the user to upload a file:
    1. Image Removed
  • When the user is dragging a file over
    • Properties for the full list of properties for the File Display Gallery component
    :
  • Image Removed
  • When the File Display Gallery is read-only, this includes when the screen is Insert excerpt_unlock_unlocknopaneltrueed:
    1. Image Removed
    These style can be changed using Formatting Rule and the new CSS Drag Over property that can be applied to a CSS Property.