Search.../

onFileDescriptorDeleted( )

Developer Preview

Triggered when a file is deleted.

Syntax

function wixMediaSiteMedia_onFileDescriptorDeleted(event: FileDescriptorDeleted): void

onFileDescriptorDeleted Parameters

NAME
TYPE
DESCRIPTION
event
Optional
FileDescriptorDeleted

Contains metadata for the event.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event that triggers when a file is deleted

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixMediaSiteMedia_onFileDescriptorDeleted(event) {
6 const eventTime = event.metadata.eventTime;
7 const entityId = event.metadata.entityId;
8
9 console.log(`File with ID ${entityId} was deleted at ${eventTime}.`);
10}
11
12/* Full event object:
13 * {
14 * "metadata": {
15 * "entityId": "d4dde1_e26da94b5cb440649ede0c433425449c~mv2.jpg",
16 * "eventTime": "2023-09-18T10:22:56.532Z",
17 * "id": "c5ad126c-26f0-4ccf-a53c-fa43ea1428bf",
18 * "triggeredByAnonymizeRequest": false
19 * }
20 * }
21 */