Skip to main content

UploadAttachmentArgs

type UploadAttachmentArgs = {
attachmentId?: string;
contentType?: string;
file: UploadFile;
fileName?: string;
};

Properties

attachmentId?

optional attachmentId: string;

Attachment ID to use. A random UUID is generated when omitted.


contentType?

optional contentType: string;

MIME type. Defaults to the Blob's type or one inferred from the file extension.


file

file: UploadFile;

The file to upload. Accepts a Blob/File (browser) or a Uint8Array of raw bytes. A Node Buffer is a Uint8Array, so await readFile(path) works directly.


fileName?

optional fileName: string;

File name. Required when file is a Uint8Array; inferred from the File.name otherwise.