Search.../

getFolderInfo( )

Gets a folder's information from the Media Manager by folderId.

Description

The getFolderInfo() function returns a Promise that resolves to information about the specified folder.

The folderId property is the internal name (unique identifier) which is generated when a folder is created by the Media Manager.

Syntax

function getFolderInfo(folderId: string): FolderInfo

getFolderInfo Parameters

NAME
TYPE
DESCRIPTION
folderId
string

Internal name (unique identifier) which is generated when a folder is created by the Media Manager.

Returns

Fulfilled - Information about the folder.

Return Type:

Promise<FolderInfo>
NAME
TYPE
DESCRIPTION
folderId
string

ID of the folder. Internal name (unique identifier) which is generated when a folder is created by the Media Manager. Use this ID when calling the listFiles(), and listFolders() functions.

folderName
string

Name of the folder.

parentFolderId
string

ID of the folder's parent folder. Use this ID when calling the listFiles(), and listFolders() functions.

_createdDate
Date

Date the folder was created.

_updatedDate
Date

Date the folder was updated.

Was this helpful?

Get a folder's information

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { mediaManager } from 'wix-media-backend';
3
4const folderId = "1bf317e889264736b5acb367415fad8e";
5
6export const myGetFolderInfoFunction = webMethod(Permissions.Anyone, async () => {
7 try {
8 const myFolder = await mediaManager.getFolderInfo(folderId);
9 const folderName = myFolder.folderName;
10 const updatedDate = myFolder._updatedDate;
11 return myFolder;
12 } catch (error) {
13 console.error(error);
14 }
15});
16
17
18/* Returns a promise that resolves to:
19 * {
20 * "folderId": "1bf317e889264736b5acb367415fad8e",
21 * "folderName": "greatfolder1",
22 * "parentFolderId": "media-root",
23 * "_createdDate": "Sun December 4 2020 14:56:15 GMT+0300",
24 * "_updatedDate": "Wed May 12 2021 14:56:15 GMT+0300"
25 * }
26 */