Update oss_service.go
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user