Skip to content

feat: file download support in browser file explorer#61

Closed
aakhter wants to merge 4 commits intoArk0N:masterfrom
aakhter:feat/file-download
Closed

feat: file download support in browser file explorer#61
aakhter wants to merge 4 commits intoArk0N:masterfrom
aakhter:feat/file-download

Conversation

@aakhter
Copy link
Copy Markdown
Contributor

@aakhter aakhter commented Apr 5, 2026

Summary

  • Add ?download=true query param to existing file-raw endpoint for Content-Disposition attachment headers
  • Add dedicated GET /api/download endpoint for filesystem file downloads
  • Add download button to the file browser UI
  • Fix 0-byte download bug by bypassing Fastify compression via reply.raw for file streams

Context

When browsing files in the Codeman web UI, there was no way to download them to your local machine. This adds a download button to each file in the browser and the backend plumbing to serve files with proper Content-Disposition headers.

Test plan

  • Open file browser -- verify download button appears on files
  • Click download -- verify file downloads with correct name and content
  • Download a large file -- verify no 0-byte truncation
  • Verify existing file-raw endpoint still works without ?download=true

Ark0N added a commit that referenced this pull request Apr 11, 2026
Cherry-picked from PR #60 (keyboard UX) and PR #61 (file download):

- Alt+1-9 session switching
- Disable Ctrl+K (too easy to trigger accidentally)
- Session rename with prefix preservation (w1-case: description)
- Shift+Enter / Ctrl+Enter multiline input via tmux send-keys -H
- Android virtual keyboard fix for non-composition input
- File download button in browser file explorer (?download=true)

Dropped from PR #60: stale package-lock.json, upload popup (missing upload.html)
Dropped from PR #61: standalone /api/download endpoint (arbitrary fs access)
Fixed from PR #60: execFileSync replaced with async execFile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Ark0N
Copy link
Copy Markdown
Owner

Ark0N commented Apr 11, 2026

Thanks! Cherry-picked the session-scoped download feature into master (f3cbe9b):

  • Download button on file tree items (hover to reveal)
  • ?download=true query param on existing /api/sessions/:id/file-raw endpoint
  • CSS styling for download button

Not included:

  • Standalone GET /api/download endpoint — allows downloading arbitrary files from the filesystem with only a regex blocklist for protection. The session-scoped endpoint already validates paths are within the session's working directory, which is the right security boundary.

@Ark0N Ark0N closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants