Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:files): correct archive name when downloading a folder

johaven147494906e7a
diff --git a/backend/src/applications/files/utils/send-file.ts b/backend/src/applications/files/utils/send-file.ts
index 88845da3..08834da2 100644
--- a/backend/src/applications/files/utils/send-file.ts
+++ b/backend/src/applications/files/utils/send-file.ts
@@ -46,7 +46,7 @@ export class SendFile {
// Ranges, LastModified, Etag are also handled
// Send function uses decodeURIComponent, but filePath is already decoded : we need to encode it again before passing it.
const encodedFilePath = encodeURIComponent(this.filePath)
- this.fileName = this.downloadName ? encodeURIComponent(this.downloadName) : fileName(encodedFilePath)
+ this.fileName = encodeURIComponent(this.downloadName ? this.downloadName : fileName(this.filePath))
const sendResult: SendResult = await send(req.raw, encodedFilePath, this.sendOptions)
// Check if the path was correctly validated
if (sendResult.metadata['path'] === undefined) {