diff --git a/frontend/src/lib/components/FilesTab.svelte b/frontend/src/lib/components/FilesTab.svelte
index db7937f..49c388b 100644
--- a/frontend/src/lib/components/FilesTab.svelte
+++ b/frontend/src/lib/components/FilesTab.svelte
@@ -91,6 +91,10 @@
const canGoUp = $derived(currentPath !== '/' && currentPath.startsWith('/'));
+ // Only regular files can be downloaded — symlinks and other non-regular types
+ // may point to devices, sockets, or directories that can't be read as a file.
+ const isDownloadable = $derived(selectedFile?.type === 'file');
+
async function navigateTo(path: string) {
// Abort any in-flight file read and invalidate stale generation so the
// abort error isn't surfaced in the UI.
@@ -215,7 +219,7 @@
}
async function handleDownload() {
- if (!selectedFile || downloading) return;
+ if (!selectedFile || downloading || selectedFile.type !== 'file') return;
downloading = true;
try {
await downloadFile(capsuleId, selectedFile.path, selectedFile.name);
@@ -678,7 +682,8 @@
{formatFileSize(selectedFile.size)}