From f92b7a562103ba8a99543a2a04c59d978fc4aa4d Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Thu, 11 Mar 2021 08:02:16 +0100 Subject: [PATCH] Browser: Shared link has content-disposition header (#11712) The shared link will be automatically downloadable when the user opens the shared link in a browser. --- cmd/web-handlers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index d7e751f29..e933b0202 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -2177,6 +2177,7 @@ func presignedGet(host, bucket, object string, expiry int64, creds auth.Credenti query.Set(xhttp.AmzCredential, credential) query.Set(xhttp.AmzDate, dateStr) query.Set(xhttp.AmzExpires, expiryStr) + query.Set(xhttp.ContentDisposition, fmt.Sprintf("attachment; filename=\"%s\"", object)) // Set session token if available. if sessionToken != "" { query.Set(xhttp.AmzSecurityToken, sessionToken)