Skip to content

contentVersionMultipart

contentVersionMultipart(options): ContentVersionMultipart

Defined in: multipart.ts:88

Build the multipart/form-data body for a ContentVersion create request.

The shape here matches Salesforce’s documented example exactly, including the trailing semicolon after name="entity_content" and the absence of a filename on that part. That absence is the reason this is hand-built rather than delegated to the platform’s FormData: a FormData part carrying Content-Type: application/json is necessarily a Blob, and a Blob part always serializes with a filename.

The entity metadata, the file to attach, and an optional fixed boundary.

string

Boundary to use. Defaults to a random one; pass a fixed value in tests.

unknown

Serialized as the JSON entity_content part.

string

Filename advertised for the VersionData part.

string

Path of the file streamed as the VersionData part.

ContentVersionMultipart

The boundary, the Content-Type header value, and a body factory.