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
Internal name (unique identifier) which is generated when a folder is created by the Media Manager.
Returns
Fulfilled - Information about the folder.
Return Type:
NAME
TYPE
DESCRIPTION
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.
Name of the folder.
ID of the folder's parent folder. Use this ID when calling the listFiles()
, and listFolders()
functions.
Date the folder was created.
Date the folder was updated.
Was this helpful?
Get a folder's information
1import { mediaManager } from 'wix-media-backend';23const folderId = "1bf317e889264736b5acb367415fad8e";45export function myGetFolderInfoFunction() {6 return mediaManager.getFolderInfo(folderId)7 .then((myFolder) => {8 const folderName = myFolder.folderName;9 const updatedDate = myFolder._updatedDate;10 return myFolder;11 })12 .catch((error) => {13 console.error(error);14 });15}161718/* 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 */