Object that is used to work with files. This class allows you to search for files or create temporary ones.

Hierarchy

  • Files

Methods

createTemporary

  • createTemporary(name: string, body: ArrayBuffer): Promise<FileItem>
  • The method creates a temporary file.

    You can temporarily upload a file to the system to use it in an app or a process. If the file is not used in 60 minutes, it will be automatically deleted. In the example you can see how to create a file using its content stored as a byte array. The context stores the newName field (the name that will be assigned to the file).

    const fileData:  ArrayBuffer;
    // ... 
    const newTmpFile = await System.files.createTemporary( Context.data.newName, fileData); 
    

    Parameters

    • name: string
    • body: ArrayBuffer

    Returns Promise<FileItem>

    Temporary file model.

search

  • The method is used to search for files on the disk.

    You can use this method to:

    • Apply filters to files based on different parameters.
    • Search for and get a specific or the first item found in the query.
    • Sort search results.
    • Limit the number of search results or see search results on several pages. Example:
      const position =  await System.files.search().where(f => f.__id.eq('<some id>')).first();
      

    Returns FilesSearch

    Object to create a file search request.