listFiles( )

Gets a list of files from the Media Manager by parentFolderId (or root).

The listFiles() function returns a Promise that resolves to information about the files in the folder.

To get a list of files within a specific folder in the Media Manager, pass the folder's ID in the parentFolderId parameter. If no folder is specified, the listFiles() function returns the list of files in the root folder of the Media Manager.

Notes:

  • This function's parameters are positional, and must be specified in the sequence shown in the syntax below. When specifying a parameter, use null as a placeholder for any unspecified parameters. For example, to specify parentFolderId only, call listFiles(filters, null, null). For example, to specify sorting only, call listFiles(null, sorting, null).

  • The listFiles() function only gets a list of files with supported media types, and that are explicitly listed in the Media Manager. Files with unsupported media types such as 'model', and files that aren't explicitly listed in the Media Manager such as default files in a gallery component, aren't listed when calling the listFiles() function. The supported media types are listed in the description for the mediaType return in the getFileInfo() function.

Method Declaration
Copy
Method Parameters
filtersFileFilterOptions

File filter options.


sortingSortingOptions

Sorting options.


pagingPagingOptions

Paging options.

Returns
Return Type:Promise<Array<File>>
Was this helpful?
Yes
No