For the complete documentation index, see llms.txt. This page is also available as Markdown.

Multipart/form-data

A form-data type that works with body payload or file upload

Upload a file

A module that uploads a file to the service works with data type buffer in mappable parameters and type multipart/form-data in communication.

The file input dialog is where the user can either choose the module that has a file available or manually map the file's name and data on their own.

This works only if the buffer is correctly implemented in interface in preceding modules.

[
	{
		"name": "file_name",
		"type": "text",
		"label": "Name",
		"required": true,
		"semantic": "file:name"
	},
	{
		"name": "file_data",
		"type": "buffer",
		"label": "Data",
		"required": true,
		"semantic": "file:data"
	}
]

The type of the request is multipart/form-data.

Preserve the order of fields

When body is an object, the order of its fields is not guaranteed, and each key can appear only once. If the API needs the fields in a specific order, or needs the same field name more than once, specify body as an array of { "name", "value" } items instead.

The array syntax:

  • sends the items in the order they are listed

  • allows repeated names, also with other fields between them (for example a, b, a)

Upload files with the array syntax

The value of a file item is either the buffer itself or an object with the buffer in value and optional options. options is either a filename string or an object with filename and/or contentType.

This is the same as wrapping the buffer without options:

Shorthand: when you only need the filename, options can be the filename string:

Send multiple files under one name

To send several files under the same field name, either set value to an array of files:

Or repeat the item. This also lets you put other fields between the files:

Last updated