Skip to content

Commit

Permalink
Ability to override content type on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 committed Oct 16, 2023
1 parent b4d9ced commit b52e308
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type FileInfoReader struct {
type FileProperties struct {
Metadata map[string]string
CacheControl string
ContentType string
}

var AvailableDrivers = []OSDriver{
Expand Down
3 changes: 3 additions & 0 deletions drivers/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ func (os *s3Session) saveDataPut(ctx context.Context, name string, data io.Reade
if err != nil {
return "", err
}
if fields != nil && fields.ContentType != "" {
contentType = fields.ContentType
}

uploader := s3manager.NewUploader(os.s3sess, func(u *s3manager.Uploader) {
u.Concurrency = uploaderConcurrency
Expand Down

0 comments on commit b52e308

Please sign in to comment.