The files object describes the commands for working with downloaded files that are available at the current endpoint. Object property names represent the command names. Each property represents an object of the following structure:
Usually used with the UploadFile control. The command is
specified in the Url
property of the control.
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
type | enum |
Obligatory. File operation type:
|
||||||||
parse | enum |
Obligatory for parse operation. Format of the file being parsed.
|
||||||||
locale | string | Optional. The locale for the file parsing. A text string representing the language and, optionally, the country. For example: "uk", "uk-UA" for Ukraine. Used in particular to parse numbers (decimal separator, thousands separator). If not specified, the standard view (a dot as a decimal separator) is used. | ||||||||
source | string | Optional. Data source. If not specified, taken from the parent item. | ||||||||
schema | string | Optional. Name of the sql schema. If not specified, taken from the parent item. | ||||||||
model | string | Name of the model. If not specified, taken from the parent item. If it is equal to an empty line, the model is not stored in the database, but simply returned to the client. | ||||||||
container | string | Obligatory for the azureBlob type. The name of the container in Azure Storage. |
||||||||
azureSource | string |
Only for the azureBlob ype. Source (connection string name) for Azure
Storage. If not specified, equals to "AzureStorage".
|
||||||||
clrType | string | Required for the clr type. A string describing the build and the .NET type. | ||||||||
async | boolean | Only for the clr type. Asynchronous execution of the clr-command. | ||||||||
parameters | object | Object, the static parameters that are passed to the stored model update procedure. The property name is the name of the parameter, the value is the value of the parameter. | ||||||||
imageCompress | object |
Controls image compression when they are uploaded to the server. For JPEG files only.
|
The operation parses the resulting file (according to the format specified in the parse
property) and presents it as a table. If a model is specified, the system attempts to save the
resulting table to the database.
Saving the model is performed as follows:
{source}: [{schema}].[{model}.Metadata]
) is called.
This procedure should return one record with a description of one table. The table name is predefined - Rows
.
{source}: [{schema}].[{model}.Update]
) is called.
The table obtained at the previous step is passed to it. The following parameters are passed to the procedure:
@TenantId
, @UserId
).parameters
property.@Rows (readonly)
- table type. Table data.
If the value of the model
property is equal to an empty string (""
), then no additional actions are
performed with the result of file parsing. The resulting table is simply returned to the client as an object with a single
Rows
property that contains an array of records for the source file.
This operation simply saves the resulting file in the database as a byte array (vabinary(max type)
).
If the imageCompress
parameter is specified, the file will (possibly) be pre-compressed. To do this,
call the stored procedure {source}: [{schema}].[{model}.Update]
. The following parameters are passed
to it (the same as in the case of saving attachments):
Name | Type | Description |
---|---|---|
@UserId | bigint | Сurrent user ID. |
@TenantId | bigint | Tenant ID (only in a multitenant environment). |
@Name | nvarchar(255) | File name (without path). |
@Mime | nvarchar(255) | MIME-type of the file. |
@Stream | varbinary(max) | File data (just bytes without conversion). |
Note that the parameter names are fixed!
The type must implement the IInvokeTarget interface. Learn more....
The name, MIME type, and (Stream
) of the received file are passed to the method.