diff --git a/s3/s3.go b/s3/s3.go index 2c5eab9fb3d1589be018717d8d695cc4c81c6e36..64c319e2db0a1d735b8bb5a227e8794babd803a3 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -112,11 +112,6 @@ func (s SessionWithHelpers) UploadWithSettings(data []byte, bucket, fileName str Body: bytes.NewReader(data), } - if settings.ExpiryDuration != nil { - expiry := time.Now().Add(*settings.ExpiryDuration) - putInput.Expires = &expiry - } - _, err := s.S3Session.PutObject(putInput) if err != nil { return "", err @@ -142,25 +137,6 @@ func (s SessionWithHelpers) UploadWithSettings(data []byte, bucket, fileName str return "", nil } -func (s SessionWithHelpers) UploadWith1DayExpiry(data []byte, bucket, fileName string, mimeType MIMEType, shouldDownloadInsteadOfOpen bool) (string, error) { - if mimeType == "" { - mimeType = getTypeForFilename(fileName) - } - - expiry := 24 * time.Hour - signedUrl, err := s.UploadWithSettings(data, bucket, fileName, S3UploadSettings{ - MimeType: mimeType, - RetrieveSignedUrl: true, - ExpiryDuration: &expiry, - AddContentDisposition: shouldDownloadInsteadOfOpen, - }) - if err != nil { - return "", err - } - - return signedUrl, nil -} - // GetSignedDownloadURL gets a signed download URL for the duration. If scv is nil, a new session will be created. func (s SessionWithHelpers) GetSignedDownloadURL(bucket string, fileName string, duration time.Duration, headers ...map[string]string) (string, error) { getInput := &s3.GetObjectInput{