Skip to main content
Version: 2027.02 Beta
View as Markdown

Perspective - File Upload

Perspective File Upload Component Icon

Component Palette Icon:

Description​

The File Upload component allows users to upload files to the Gateway or other locations from a Perspective session using a script action on the onFileReceived component event. For an example, see Download and Upload Files page.

The component has different appearances based on its width. When initially dragged onto your View, a Browse button will be visible and paired with "Drag files here" text. At smaller widths, the component defaults to a simple cloud icon and no text. This icon can be changed using the fileUploadIcon property settings.

Properties​

Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.

NameDescriptionProperty Type
enabledDetermines whether or not the component is enabled. Note that the color and style enabled/disabled properties are dependent on this property state. Default is true.value: boolean
maxUploadsThe maximum number of concurrent (simultaneous) uploads to allow. Default is 5.value: integer
supportedFileTypesAn array of string values, indicating what file types are allowed to be uploaded. Example values are pdf or txt.array
fileSizeLimitSpecifies the maximum size of each uploaded file, in megabytes (MB). Default is 10 MB. Note that values over 20 MB are not allowed, unless the max-file-size property in the web.xml configuration file is set to a higher limit, as the max-file-size property overrides this setting.value: integer
fileUploadIconDetermines the icon used when the File Upload component is small.
  • path: Shorthand path to the icon source. Format is library/iconName. The materials icon library is a the primary source for icons. Value is string.
  • color: Color of the placeholder icon, if it exists. Can be chosen from a color wheel, a color palette, or entered as an RGB or HSL value. See Color Selector for more information.
    • enabled: Color of the icon when the parent enabled property is set to true.
    • disabled: Color of the icon when the parent enabled property is set to false.
  • style: Sets a style for the icon.
object
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
  • enabled: Style of the component when the parent enabled property is set to true.
  • disabled: Style of the component when the parent enabled property is set to false.
object

Component Scripts and Events​

Further component interaction and functionality can be configured for all components through scripting and event actions. Right-click on the component or select Components from the Designer menubar to access the configuration popups for both of these options:

  • Configure Events: Accesses the Event Configuration popup where you can configure actions to run in response to events to make the component dynamic. The Events Configurations page shows how to configure events and actions on a Perspective component.

  • Configure Scripts: Accesses the Script Configuration popup where custom methods and message handlers can be added. The Scripting in Perspective section details scripting fundamentals, creating custom methods, and using message handlers.

The File Upload component also has Component Events and Functions associated with it. See the Perspective - File Upload Scripting page for more information.