Classes
Methods
# async create(file, metadata) → {Promise.<EntityFile>}
Uploads a new temporary file. Use this to upload a file as a form value along with the basic file meta data. The file size must not exceed 1GB.
Parameters:
Name | Type | Description |
---|---|---|
file |
File
|
Buffer
|
|
metadata |
FileMetaData
|
Promise.<EntityFile>
# async download(fileId) → {Promise.<String>}
Returns the content of the temporary file.
Parameters:
Name | Type | Description |
---|---|---|
fileId |
String
|
The id of the file. |
Promise.<String>
# async get(fileId) → {Promise.<EntityFile>}
Returns the meta information of the temporary file of the current user.
Parameters:
Name | Type | Description |
---|---|---|
fileId |
String
|
The id of the file. |
Promise.<EntityFile>
# async list(optionsopt) → {Promise.<Array.<EntityFile>>}
Returns the meta information of all temporary files of the current user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
ListOptions
|
<optional> |
Pagination and filtering options |
Promise.<Array.<EntityFile>>
# async setEntity(fileId, entityObject) → {Promise.<void>}
Sets the temporary file to a global or entity file. Links the temporary file to the specified entity or switches to a global file if the 'EntityId' of the model is set to null. The file is no longer a temporary file afterwards and becomes visible.
Parameters:
Name | Type | Description |
---|---|---|
fileId |
String
|
The id of the file. |
entityObject |
LinkedEntity
|
Promise.<void>
# async update(fileId, temporaryFile) → {Promise.<EntityFile>}
Updates the meta information of the temporary file with the specified id.
Parameters:
Name | Type | Description |
---|---|---|
fileId |
String
|
The id of the file. |
temporaryFile |
TemporaryFilesUpdateModel
|
The model to update the temporary file. |
Promise.<EntityFile>