• JMap.Attachment.download

    Downloads an attachment and returns the raw binary data plus the HTTP headers sent by the server.

    Parameters

    • dataSourceId: string

      the JMap data source id

    • attachmentId: string

      the attachment to download

    Returns Promise<{
        data: Blob;
        headers: any;
    }>

    Example

    JMap.Attachment
    .download("f47ac10b-58cc-4372-a567-0e02b2c3d479", "d9428888-122b-11e1-b85c-61cd3cbb3210")
    .then(({ data, headers }) => console.log("Downloaded attachment", headers["content-type"], data.size))
    .catch(error => console.error("Download failed", error))