Skip to main content

delete

Delete file from oneentry cloud storage.

Description

This void method delete a file from the cloud file storage.

FileUploading.delete(

filename, fileQuery, fileQuery.type, fileQuery.entity, fileQuery.id, fileQuery.width, fileQuery.height, fileQuery.compress

);

Parameters schema

Schema

filename: string
File name
example: "file.png"

fileQuery: IUploadingQuery
Optional set query parameters
example:

{
"type": "page",
"entity": "editor",
"id": 3787,
"template": 1
}

fileQuery.type(required): string
Type, determines the folder name in the storage.
example: "page"

fileQuery.entity(required): string
Entity name from which the file is uploaded, determines the folder name in the storage.
example: "editor"

fileQuery.id(required): number
Identifier of the object from which the file is uploaded, determines the folder name in the storage.
example: 3787

fileQuery.width: number
Width parameter.
example: 0

fileQuery.height: number
Height parameter.
example: 0

fileQuery.compress: boolean
Flag of optimization (compression) for images.
example: true

Examples

Minimal example

const fileQuery = {
"type": "page",
"entity": "editor",
"id": 3787,
}

const response = await FileUploading.delete('file.png', fileQuery);