The full requested path given by the user
The file sources which are available for browsing
Track the active source tab which is being browsed
A callback function to trigger once a file has been selected
The latest set of results browsed from the server
The general file type which controls the set of extensions which will be accepted
The target HTML element this file picker is bound to
A button which controls the display of the picker UI
The display mode of the FilePicker UI
The current set of file extensions which are being filtered upon
The options provided to this application upon initialization
An internal reference to the HTML element this application renders
Track the current position and dimensions of the Application UI
DragDrop workflow handlers which are active for this Application
Tab navigation handlers which are active for this Application
SearchFilter handlers which are active for this Application
Track whether the Application is currently minimized
Track the most recent scroll positions for any vertically scrolling containers
The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT
Protected
_stateThe current render state of the Application
Protected
_priorThe prior render state of this Application. This allows for rendering logic to understand if the application is being rendered for the first time.
Static
FILE_The allowed values for the type of this FilePicker instance.
Static
LAST_Record the last-browsed directory path so that re-opening a different FilePicker instance uses the same target
Static
LAST_Record the last-configured tile size which can automatically be applied to new FilePicker instances
Static
LAST_Record the last-configured display mode so that re-opening a different FilePicker instance uses the same mode.
Static
DISPLAY_Enumerate the allowed FilePicker display modes
Static
S3_Cache the names of S3 buckets which can be used
Static
RENDER_The sequence of rendering states that track the Application life-cycle.
Return the source object for the currently active source
Return the target directory for the currently active source
Return a flag for whether the current user is able to upload file content
Return the CSS application ID which uniquely references this UI element
Return the active application element, if it currently exists in the DOM
The path to the HTML template file which should be used to render the inner content of the app
Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered
Return a flag for whether the Application instance is currently rendered
Whether the Application is currently closing.
Static
favoritesGet favorite folders for quick access
Static
defaultStatic
uploadURLReturn the upload URL to which the FilePicker should post uploaded files
Set the application position and store its new location. Returns the updated position object for the application containing the new values.
Positional data
Render the Application by evaluating it's HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls
Add the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present.
Additional rendering options which are applied to customize the way that the Application is rendered in the DOM.
The rendered Application instance
Change the currently active tab
The target tab name to switch to
Options which configure changing the tab
A specific named tab group, useful if multiple sets of tabs are present
Whether to trigger tab-change callback functions
Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes
Optional
options: object = {}Options which affect how the Application is closed
A Promise which resolves once the application is closed
closeApplication
Protected
_onProtected
_renderProtected
An asynchronous inner function which handles the rendering of the Application
Render and display the application even if it is not currently displayed.
Additional options which update the current values of the Application#options object
A Promise that resolves to the Application once rendering is complete
renderApplication
Protected
_callProtected
Internal
Call all hooks for all applications in the inheritance chain.
The hook being triggered, which formatted with the Application class name
Rest
...hookArgs: any[]The arguments passed to the hook calls
Protected
_saveProtected
_restoreProtected
_renderProtected
_getProtected
Specify the set of config buttons which should appear in the Application header. Buttons should be returned as an Array of objects. The header buttons which are added to the application can be modified by the getApplicationHeaderButtons hook.
getApplicationHeaderButtons
Protected
_activateProtected
_onProtected
_waitPrivate
#onPrivate
#validatePrivate
#onPrivate
#onPrivate
#onPrivate
#onPrivate
#onPrivate
#createPrivate
#onPrivate
#onStatic
setStatic
removeStatic
matchStatic
browseBrowse files for a certain directory location
The source location in which to browse. See FilePicker#sources for details
The target within the source location
Optional arguments
A bucket within which to search if using the S3 source
An Array of file extensions to filter on
The requested dir represents a wildcard path
A Promise which resolves to the directories and files contained in the location
Static
configureConfigure metadata settings regarding a certain file system path
The source location in which to browse. See FilePicker#sources for details
The target within the source location
Optional arguments which modify the request
Static
createCreate a subdirectory within a given source. The requested subdirectory path must not already exist.
The source location in which to browse. See FilePicker#sources for details
The target within the source location
Optional arguments which modify the request
Static
uploadDispatch a POST request to the server containing a directory path and a file to upload
The data source to which the file should be uploaded
The destination path
The File object to upload
Optional
body: object = {}Additional file upload options sent in the POST body
Optional
options: { Additional options to configure how the method behaves
Display a UI notification when the upload is processed
The response object
Static
uploadA convenience function that uploads a file to a given package's persistent /storage/ directory
The id of the package to which the file should be uploaded. Only supports Systems and Modules.
The relative destination path in the package's storage directory
The File object to upload
Optional
body: object = {}Additional file upload options sent in the POST body
Optional
options: { Additional options to configure how the method behaves
Display a UI notification when the upload is processed
The response object
Static
fromBind the file picker to a new target field. Assumes the user will provide a HTMLButtonElement which has the data-target and data-type attributes The data-target attribute should provide the name of the input field which should receive the selected file The data-type attribute is a string in ["image", "audio"] which sets the file extensions which will be accepted
The button element
Static
Private
#getStatic
Private
#manage
The FilePicker application renders contents of the server-side public directory. This app allows for navigating and uploading files to the public path.
Param: options
Options that configure the behavior of the FilePicker