Skip to content

Function: toFormDataFile()

ts
function toFormDataFile(attachment): Promise<Blob>;

Defined in: src/core/formData/multipartRequest.ts:207

One AttachmentInput as a single FormData-appendable part.

Multipart endpoints assemble their own FormData and append each attachment to it, so they need the content as one value rather than as a whole encoded body — that is what this provides, and createMultipartRequestBody is the streaming alternative for callers building a request by hand.

Streaming content is collected here: a FormData part has to know its length, so a stream cannot stay lazy once it goes into one.

Parameters

ParameterType
attachmentAttachmentInput

Returns

Promise&lt;Blob>