@cpod/sdk - v0.2.7
    Preparing search index...

    Function downloadFiles

    • Download files by path

      Parameters

      Returns Promise<Blob>

      Blob containing the binary file data

      401 - Not authenticated

      404 - File not found

      import { downloadFiles } from "@cpod/sdk";

      // Download file and create download link
      const blob = await downloadFiles({
      object_path: "source-name/document.pdf"
      });

      // Create download URL in browser
      const url = URL.createObjectURL(blob);
      const a = document.createElement('a');
      a.href = url;
      a.download = 'document.pdf';
      a.click();
      URL.revokeObjectURL(url);