File Download
Description
The download part is located in form nodes and it allows application end users to download specified files to their file system from a LogicNets-based application.
Use
This part is located in the general form nodes for general applications and in form-part nodes for applications built using the Assessment Framework. It allows the application developer to provide a list of files in a collection, directory path, or data table for application users to download. Users can download the selected file or files to a local system or open the file in a new browser if the browser supports that file type.
LogicNets accepts all file types for download; however, the files will only open in the browser if the browser allows that file type.
Editor Fields
When adding a file download option to an application, the application developer uses the following fields.
Field Name | Description/Use | Type/Options | Optional/Mandatory |
Question | This field allows you to enter any text you want to display to the user. | Text | Optional |
Options | These are the download options.
|
Dropdown Menu | Mandatory |
Directory | This is the storage location of the files for download by the download control. | Text | Mandatory |
Sub folder | This option becomes available when the storage location is set to '(local) \appdata' or '(local) \temp'. It allows you to specify the subfolder within the given directory to which the file(s) must be uploaded. | Text | Optional |
(whitelisted) Path | This option becomes available when the storage location is set to 'external directory'. It allows you to specify the path to the external directory. NOTE: External directories must be whitelisted in the settings.cfg file before the file can be downloaded. | Text | Mandatory |
Storage location | This is the storage location of the file(s):
|
Dropdown Menu | Mandatory |
File type filter | This field allows you to specify file type filters separated by a colon; for example, “.txt, .css, .html”. In this case, the system will only display files of type txt, css, or html. If the application developer does not set a filter type the system displays all available files. | Text (case sensitive) | Optional |
Action | This parameter specifies the possible actions for the user:
|
Dropdown Menu | Mandatory |
Show stamp | If you check this checkbox the system shows an additional column for the time stamps of the files in the downloaded result. | Checkbox | Optional |
Show delete button | If you check this checkbox the system will display a file delete button in the actions list. This allows users to remove a file from the list. | Checkbox | Optional |
Submit after delete | If you click this checkbox the system will step the logicnet forward when the user clicks the delete button. This would allow you to display the outcome of the delete action, for example. | Checkbox | Optional |
Deleted file (data object) | This option is only available if 'show delete button' is activated. When a user deletes a file, the system saves the following information on the provided location:
|
Text | Optional |
Custom headers | If you check this box the system displays your custom text instead of the predefined table headers. You enter the custom text in the following fields. | Checkbox | Optional |
Custom header: Caption | This option is only available if 'Custom headers' is activated. This field holds the text the system will display as the header instead of the default value 'Caption'. | Text | Optional |
Custom header: Time stamp | This option is only available if 'Custom headers' is activated. This field holds the text the system will display instead of the default value 'Time stamp'. | Text | Optional |
Custom header: Actions | This option is only available if 'Custom headers' is activated. This field holds the text the system will display instead of the default value 'Actions'. | Text | Optional |
Directly start download | If you check this option the system downloads the item specified in the ItemId field. The ItemId points to the item in the collection (index) or the Id of the record in the database table. The system will not display the download control. | Checkbox | Optional |
Styling
The file upload and download parts contain the standard form part template in the Assessment Framework, and in that use case are presented on screen in the same style as regular form parts for radiolists, checklists, etc. Additionally its is possible to use the part css class in the style tab to assign additional CSS declations.
In Release 7.3 and prior, to override the default styling of the table with all the files, you must override the file_download_table class in your custom CSS file. For example, .file_download_table { font-size:16px; }
Example
Please download and import the following example project to your workspace.