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.
Parameters
Section titled “Parameters”options
Section titled “options”The entity metadata, the file to attach, and an optional fixed boundary.
boundary?
Section titled “boundary?”string
Boundary to use. Defaults to a random one; pass a fixed value in tests.
entity
Section titled “entity”unknown
Serialized as the JSON entity_content part.
filename
Section titled “filename”string
Filename advertised for the VersionData part.
filePath
Section titled “filePath”string
Path of the file streamed as the VersionData part.
Returns
Section titled “Returns”The boundary, the Content-Type header value, and a body factory.