Skip to main content

delete

Delete a file from OneEntry cloud storage.

Description​

Deletes a file from cloud storage and resolves to true. Pass the same type, entity and id that were used for the upload: they identify the storage folder, and the API rejects the request with 400 if any of them is missing.

.delete(

,

);

Parameters schema​

Schema

filename(required): string
File name.
example: "file.png"

fileQuery(required): IUploadingQuery
Where the file is stored. Required: without type, entity and id the endpoint answers 400 … should not be empty.
example:

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

fileQuery.type(required): string
Storage type; determines the folder the file is stored in, for example "page".
example: "page"

fileQuery.entity(required): string
Name of the entity the file belongs to; sets the folder name in the storage.
example: "editor"

fileQuery.id(required): number
ID of the object the file belongs to; sets the folder name in the storage.
example: 3787

fileQuery.width: number
Not used by the upload and delete endpoints.
example: 0

fileQuery.height: number
Not used by the upload and delete endpoints.
example: 0

fileQuery.compress: boolean
Whether to compress (optimize) uploaded images.
example: true

Examples​

Minimal example​


const = {
,
,
,
}

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