MediaUploadInput
MediaUploadInput =
Blob| {file:MediaBytes;filename?:string;type?:string; }
Defined in: src/types/media.ts:21
Input accepted by MediaResource.upload.
Either a Blob/File directly (its type is used as the content
type), or an object wrapping raw bytes with an explicit content type and
optional display filename. When bytes carry no inferable content type and
none is supplied, upload throws WhatsAppValidationError.
Union Members
Section titled “Union Members”Blob
Type Literal
Section titled “Type Literal”{ file: MediaBytes; filename?: string; type?: string; }
file:
MediaBytes
File contents as a Blob/File, Uint8Array, or ArrayBuffer.
filename?
Section titled “filename?”
optionalfilename?:string
Display filename for the uploaded file part.
optionaltype?:string
MIME content type, e.g. image/jpeg. Required when it can’t be inferred.
Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.