Skip to content
Snippets Groups Projects
Commit 09b84c4a authored by Cornel Rautenbach's avatar Cornel Rautenbach
Browse files

Add should download to UploadWith1DayExpiry

parent 9fc0b76d
Branches
Tags v1.22.0
No related merge requests found
......@@ -135,7 +135,7 @@ func (s SessionWithHelpers) UploadWithSettings(data []byte, bucket, fileName str
return "", nil
}
func (s SessionWithHelpers) UploadWith1DayExpiry(data []byte, bucket, fileName string, mimeType MIMEType) (string, error) {
func (s SessionWithHelpers) UploadWith1DayExpiry(data []byte, bucket, fileName string, mimeType MIMEType, shouldDownloadInsteadOfOpen bool) (string, error) {
if mimeType == "" {
mimeType = getTypeForFilename(fileName)
}
......@@ -145,6 +145,7 @@ func (s SessionWithHelpers) UploadWith1DayExpiry(data []byte, bucket, fileName s
MimeType: mimeType,
RetrieveSignedUrl: true,
ExpiryDuration: &expiry,
AddContentDisposition: shouldDownloadInsteadOfOpen,
})
if err != nil {
return "", err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment