Skip to content

feat: folder transfer with automatic zipping #20

@PranavAgarkar07

Description

@PranavAgarkar07

Goal

Allow users to select entire folders for transfer. Folders should be automatically zipped on the sender side before transfer and unzipped on the receiver side after download.

Deliverables

1. Folder Selection (Sender)

  • Add folder picker using Wails runtime OpenDirectoryDialog or HTML input with webkitdirectory
  • When a folder is selected:
    • Show folder name and total file count in the UI
    • Auto-zip the folder into a temporary .zip archive
    • Show zipping progress if the folder is large
    • Transfer the .zip file like a regular file
    • Clean up the temp .zip after transfer completes or fails

2. Auto-Unzip (Receiver)

  • Detect .zip MIME type on receive
  • After file is saved, auto-extract to a subdirectory named after the zip (without extension)
  • Preserve directory structure inside the zip
  • Show extraction status / completion notification
  • Optionally delete the .zip after extraction (configurable)

3. Backend Support

  • Go standard library archive/zip for both zipping and unzipping
  • Streaming zip: write zip entries as files are read (avoid loading entire folder into RAM)
  • Handle nested directories, long paths, special characters
  • Progress events during zipping/unzipping

4. Frontend

  • Visual indicator that a transfer is a folder (folder icon, "3 files, 12.4 MB" summary)
  • Progress bar during zip creation
  • Toast on completion: "Folder received and extracted"

Design Notes

  • Max folder size warning: show dialog if >500 MB before zipping
  • Single file transfers unchanged — folder zipping only triggers for directories
  • Hidden files (starting with .) are included by default

Acceptance Criteria

  • User can select a folder via folder picker
  • Folder is zipped before transfer starts
  • Zipping progress is shown (for large folders)
  • Zip is transferred like a regular file
  • Receiver detects .zip and auto-extracts
  • Directory structure preserved after extraction
  • Temp .zip cleaned up after success or failure
  • Handles nested directories correctly
  • Works on Linux (sender and receiver)
  • Unit tests for zip/unzip helpers

References

  • beamsync/server.go:1074-1212 — sender download handler
  • beamsync/server.go:668-905 — receiver upload handler
  • desktop/app.go:263-360 — server lifecycle
  • desktop/frontend/src/App.svelte — file selection UI (drag-drop area)
  • Go archive/zip package — standard library, no extra deps

Points (GSSoC)

  • Difficulty: intermediate
  • Type: feature
  • Base Score: 50 + (2 x 1) + 10 = 62 points
  • Labels: level:intermediate, type:feature, gssoc:approved

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions