• JMap.Attachment.downloadToDevice

    Triggers a browser download for the provided file attachment.

    Parameters

    • attachment: JAttachmentFile

      the attachment to download

    • dataSourceId: string

      the JMap data source id

    Returns Promise<void>

    Example

    JMap.Attachment
    .downloadToDevice(
    {
    id: "d9428888-122b-11e1-b85c-61cd3cbb3210",
    organizationId: "c56a4180-65aa-42ec-a945-5fd21dec0538",
    thumbnail: "",
    fileId: "c56a4180-65aa-42ec-a945-5fd21dec0538",
    fileName: "inspection.jpg",
    fileSize: 481516,
    mimeType: "image/jpeg"
    },
    "f47ac10b-58cc-4372-a567-0e02b2c3d479"
    )
    .then(() => console.log("Download started"))
    .catch(error => console.error("Download failed", error))