diff --git a/backend/handlers/files.go b/backend/handlers/files.go index bfb68f6..250affe 100644 --- a/backend/handlers/files.go +++ b/backend/handlers/files.go @@ -1032,6 +1032,7 @@ func (h *FSHandler) Download(c *fiber.Ctx) error { // Set appropriate headers for range requests c.Set("Accept-Ranges", "bytes") c.Set("Content-Type", mime.TypeByExtension(filepath.Ext(resolvedPath))) + c.Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", info.Name())) // Use Fiber's built-in SendFile which supports Range requests return c.SendFile(resolvedPath) diff --git a/backend/handlers/sharing.go b/backend/handlers/sharing.go index 8910c52..748f1aa 100644 --- a/backend/handlers/sharing.go +++ b/backend/handlers/sharing.go @@ -417,5 +417,6 @@ func (h *ShareHandler) DownloadPublicShare(c *fiber.Ctx) error { return nil } + c.Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", info.Name())) return c.SendFile(fullPath) }