Skip to main content

getFile

Search file in oneentry cloud storage.

Description

This method return file object by parameters. It returns a Promise that resolves to an File object.

FileUploading.getFile(

id*, type*, entity*, filename*, template

);

Parameters schema

Schema

id(required): number
Object identifier, from which the file is uploaded, determines the folder name in the storage
example: 3787

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

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

filename(required): string
Filename
example: "file.png"

template: string
Preview template identifier
example: 1

Examples

Minimal example

const response = await FileUploading.getFile(123, 'page', 'editor', 'file.png');

Example response

{
"status": 200,
"url": "https://your-project.oneentry.cloud/api/content/files?id=3787&type=page&entity=editor&filename=errors-1751677276135.md"
}

Response schema

Schema: File