Update oss_service.go

This commit is contained in:
Lizandro Guarnizo
2026-06-11 17:47:46 -05:00
parent cf078a6e5f
commit fa0991eed7
+2 -6
View File
@@ -207,9 +207,7 @@ func (s *s3OSS) PublicURL(objectKey string) string {
func (s *s3OSS) UploadFile(objectKey, filePath string) error {
ctx := context.Background()
_, err := s.client.FPutObject(ctx, s.bucketName, objectKey, filePath, minio.PutObjectOptions{
UserMetadata: map[string]string{
"Content-Disposition": "attachment",
},
ContentDisposition: "attachment",
})
if err != nil {
return fmt.Errorf("error subiendo archivo a S3: %w", err)
@@ -285,9 +283,7 @@ func (s *s3OSS) SignedURL(objectKey string, expireSeconds int) (string, error) {
func (s *s3OSS) UploadFromReader(objectKey, contentType string, r io.Reader) error {
ctx := context.Background()
opts := minio.PutObjectOptions{
UserMetadata: map[string]string{
"Content-Disposition": "attachment",
},
ContentDisposition: "attachment",
}
if contentType != "" {
opts.ContentType = contentType