Use the File Chooser builder to give a user the ability to select a file on the server. To open it, for example.
The File Chooser builder displays a list of files and directories from which the user can select. The builder generates a list of files and directories based on a starting directory and a filter that the user provides. The list is displayed in the Tree builder, and the list is cached so that it does not need to be generated every time.
- The file path selected is returned as a form input. When the user selects a file in the File Chooser, the name of the file is stored in a hidden form input whose value is available after form submission like any other input control. This input has the same name as the span name assigned to the File Chooser builder. For example:
is the name of the <span />
tag assigned to the File Chooser builder
- Make sure the directories available to users are not confidential. Before you use the File Chooser builder, make sure you have traversed the file tree to make sure there is nothing confidential hidden in subfolders.
- The HTML Event Action can intercept selection changes. To automatically submit the form and run an action as the File Chooser's selection is changed by the user, you can target an HTML Event Action builder at the File Chooser. Select onChange as the event, and Submit form and invoke action to run a model action on each change.
Parent topic: Builder Reference: wpf7
About using the builder call editor: wpf7
Overview: creating forms: wpf7
Locating control builder calls on pages: wpf7