> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getFileDescriptors(fileIds: Array) # Method package: wixMediaV2 # Method menu location: wixMediaV2 --> files --> getFileDescriptors # Method Link: https://dev.wix.com/docs/velo/apis/wix-media-v2/files/get-file-descriptors.md # Method Description: Gets information about specific files in the Media Manager. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get file descriptors (dashboard page code) ```javascript import { files } from 'wix-media.v2'; /* Sample fileIds value: * [ * 'w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q', * 'w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg', * 'w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip' * ] */ async function myGetFileDescriptorsFunction(fileIds) { try { const descriptors = await files.getFileDescriptors(fileIds); console.log('Retrieved descriptors:', descriptors); return descriptors; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "files": [ * { * "_createdDate": "2023-07-23T09:05:12.000Z", * "_id": "w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg", * "_updatedDate": "2023-07-23T09:05:12.000Z", * "displayName": "image1.jpg", * "hash": "d7ltmbrrmdspiyrw3db29bpi1g8lsacz", * "internalTags": [], * "labels": [], * "media": { * "image": { * "faces": [], * "image": "wix:image://v1/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg/image1.jpg#originWidth=1000&originHeight=714" * } * }, * "mediaType": "IMAGE", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "112689", * "sourceUrl": "https://website.org/image1.jpg", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg", * "url": "https://static.wixstatic.com/media/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg" * }, * { * "_createdDate": "2023-07-16T08:56:10.000Z", * "_id": "w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip", * "_updatedDate": "2023-07-20T07:16:55.000Z", * "displayName": "pics", * "hash": "tmk0uafvzzgkddrgwgl6od1h9jsp1j9e", * "internalTags": [ * "_fileOrigin_uploaded" * ], * "labels": [], * "media": { * "archive": { * "_id": "w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip", * "filename": "riverpics", * "sizeInBytes": "49546083", * "url": "https://3ecba886-4267-11ee-be56-0242ac120002.usrfiles.com/archives/w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip" * } * }, * "mediaType": "ARCHIVE", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "49546083", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/48c4fbc47d7298cd4406936294b4c532.png", * "url": "https://3ecba886-4267-11ee-be56-0242ac120002.usrfiles.com/archives/w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip" * }, * { * "_createdDate": "2023-07-23T12:15:55.000Z", * "_id": "w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q", * "_updatedDate": "2023-07-23T12:16:14.000Z", * "displayName": "video1.mp4", * "hash": "pdrepnjy3cdjq8bt2lzmpdvuc47mm921", * "internalTags": [], * "labels": [], * "media": { * "video": "wix:video://v1/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q/video1.mp4#posterUri=w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2qf001.jpg&posterWidth=1280&posterHeight=720" * }, * "mediaType": "VIDEO", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "4384468", * "sourceUrl": "https://cdn.pixabay.com/example.mp4", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2qf002.jpg", * "url": "https://video.wixstatic.com/video/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q/file" * } * ] * } */ ``` ## Get file descriptors (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { files } from 'wix-media.v2'; import { elevate } from 'wix-auth'; /* Sample fileIds value: * [ * 'w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q', * 'w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg', * 'w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip' * ] */ export const myGetFileDescriptorsFunction = webMethod(Permissions.Anyone, async (fileIds) => { try { const elevatedGetFileDescriptors = elevate(files.getFileDescriptors); const descriptors = await elevatedGetFileDescriptors(fileIds); console.log('Retrieved descriptors:', descriptors); return descriptors; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "files": [ * { * "_createdDate": "2023-07-23T09:05:12.000Z", * "_id": "w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg", * "_updatedDate": "2023-07-23T09:05:12.000Z", * "displayName": "image1.jpg", * "hash": "d7ltmbrrmdspiyrw3db29bpi1g8lsacz", * "internalTags": [], * "labels": [], * "media": { * "image": { * "faces": [], * "image": "wix:image://v1/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg/image1.jpg#originWidth=1000&originHeight=714" * } * }, * "mediaType": "IMAGE", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "112689", * "sourceUrl": "https://website.org/image1.jpg", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg", * "url": "https://static.wixstatic.com/media/w8ide0_mnk3lozhxu0w4f1g5wuusmwqedox2w1p~mv2.jpg" * }, * { * "_createdDate": "2023-07-16T08:56:10.000Z", * "_id": "w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip", * "_updatedDate": "2023-07-20T07:16:55.000Z", * "displayName": "pics", * "hash": "tmk0uafvzzgkddrgwgl6od1h9jsp1j9e", * "internalTags": [ * "_fileOrigin_uploaded" * ], * "labels": [], * "media": { * "archive": { * "_id": "w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip", * "filename": "riverpics", * "sizeInBytes": "49546083", * "url": "https://3ecba886-4267-11ee-be56-0242ac120002.usrfiles.com/archives/w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip" * } * }, * "mediaType": "ARCHIVE", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "49546083", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/48c4fbc47d7298cd4406936294b4c532.png", * "url": "https://3ecba886-4267-11ee-be56-0242ac120002.usrfiles.com/archives/w8ide0_578uul37zvr7b6d7ji3cbm91rlf5dvjy.zip" * }, * { * "_createdDate": "2023-07-23T12:15:55.000Z", * "_id": "w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q", * "_updatedDate": "2023-07-23T12:16:14.000Z", * "displayName": "video1.mp4", * "hash": "pdrepnjy3cdjq8bt2lzmpdvuc47mm921", * "internalTags": [], * "labels": [], * "media": { * "video": "wix:video://v1/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q/video1.mp4#posterUri=w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2qf001.jpg&posterWidth=1280&posterHeight=720" * }, * "mediaType": "VIDEO", * "operationStatus": "READY", * "parentFolderId": "media-root", * "private": false, * "siteId": "3ecba886-4267-11ee-be56-0242ac120002", * "sizeInBytes": "4384468", * "sourceUrl": "https://cdn.pixabay.com/example.mp4", * "state": "OK", * "thumbnailUrl": "https://static.wixstatic.com/media/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2qf002.jpg", * "url": "https://video.wixstatic.com/video/w8ide0_87051wjiadg6qj2ywxb07vn5snqxxp2q/file" * } * ] * } */ ``` ---