Skip to content

Require folder destination for receiver downloads over 7GB#12

Open
derekShaheen wants to merge 3 commits into
masterfrom
codex/implement-folder-download-for-large-files
Open

Require folder destination for receiver downloads over 7GB#12
derekShaheen wants to merge 3 commits into
masterfrom
codex/implement-folder-download-for-large-files

Conversation

@derekShaheen

Copy link
Copy Markdown
Owner

Motivation

  • Large transfers and very large files can exhaust browser memory or fail when held in-memory during WebRTC -> blob download, so streaming directly to disk is needed for reliability.
  • The UX should require a folder target when the total selected download exceeds a safe threshold to avoid high likelihood of failure for transfers >7GB.
  • Browsers without the File System Access API must continue to work with the existing in-memory + Save-link fallback.

Description

  • Added a Choose folder button and contextual helper text in public/pages/receiver.html to surface folder-based download options to the receiver.
  • Implemented folder-targeted streaming in public/assets/scripts/receiver.js using the File System Access API (showDirectoryPicker, getFileHandle, createWritable) and a streamWriter path to write incoming binary chunks directly to disk.
  • Introduced thresholds LARGE_TRANSFER_THRESHOLD = 7 * 1024 * 1024 * 1024 and LARGE_FILE_THRESHOLD = 8 * 1024 * 1024 * 1024 and enforced that if selected total bytes > 7GB the receiver must choose a folder before starting, while recommending folder use when any single file > 8GB.
  • Preserved the existing in-memory Blob + Save-link flow for unsupported browsers or smaller transfers and added UI updates via updateFolderUi() and selection handlers to reflect folder state.

Testing

  • Ran node --check public/assets/scripts/receiver.js and it completed successfully.
  • Ran node --check server.js and it completed successfully.
  • Started the app with npm start and verified the server listens on http://0.0.0.0:3000 (startup succeeded).
  • Captured a Playwright screenshot of the receiver page at http://127.0.0.1:3000/receiver.html to validate UI render (screenshot saved as an artifact).

Codex Task

@railway-app railway-app Bot temporarily deployed to marvelous-magic / production February 14, 2026 23:47 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant