directory downloads (zipped)

This commit is contained in:
2025-08-29 21:20:44 +02:00
parent 76713db985
commit 3498a2926c
11 changed files with 368 additions and 47 deletions

View File

@@ -125,10 +125,15 @@ function onDowloadClicked() {
return;
}
downloadFile(
share.file.name,
getApiUrl(`warrens/files/cat_share?shareId=${share.data.id}&path=/`)
const downloadName =
share.file.fileType === 'directory'
? `${share.file.name}.zip`
: share.file.name;
const downloadApiUrl = getApiUrl(
`warrens/files/cat_share?shareId=${share.data.id}&path=/`
);
downloadFile(downloadName, downloadApiUrl);
}
function onEntryDownload(entry: DirectoryEntry) {
@@ -136,12 +141,13 @@ function onEntryDownload(entry: DirectoryEntry) {
return;
}
downloadFile(
entry.name,
getApiUrl(
`warrens/files/cat_share?shareId=${share.data.id}&path=${joinPaths(warrenStore.current.path, entry.name)}`
)
const downloadName =
entry.fileType === 'directory' ? `${entry.name}.zip` : entry.name;
const downloadApiUrl = getApiUrl(
`warrens/files/cat_share?shareId=${share.data.id}&path=${joinPaths(warrenStore.current.path, entry.name)}`
);
downloadFile(downloadName, downloadApiUrl);
}
</script>