Hierarchy

  • FileField

Methods

create

  • create(name: string, body: ArrayBuffer): Promise<FileItem>
  • The method creates a file in the process context.

    Parameters

    • name: string
    • body: ArrayBuffer

    Returns Promise<FileItem>

createFromLink

  • createFromLink(name: string, url: string): Promise<FileItem>
  • The method uploads a file from an external source to the process context.

    Parameters

    • name: string
    • url: string

    Returns Promise<FileItem>

createFromStream

  • createFromStream(name: string, stream: ReadableStream): Promise<FileItem>
  • Create a file from the stream in the process context.

    Parameters

    • name: string
    • stream: ReadableStream

    Returns Promise<FileItem>

fetchAll

  • Request all associated files.

    If a field stores multiple links to files, you can request all of them at once:

    const files = await Context.fields.files.fetchAll();
    

    Returns Promise<FileItem[]>