Skip to content

Download endpoint buffers entire object in browser memory #307

Description

@lfrancke

File: src/lib/storage/download.ts

downloadObject fetches the full S3 object body via the /storage/api/download endpoint, buffers it as a Blob in browser memory, then triggers a programmatic anchor click. This is simpler than streaming directly to disk but means the entire object must fit in browser memory before the save dialog appears. Acceptable for the current object sizes; for very large files (multiple GiB) this will cause memory pressure. Long-term fix: use the File System Access API createWritable() to stream bytes directly to disk without buffering, with a fallback to the current Blob approach for Firefox (which does not support showSaveFilePicker).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions