fix cloudflare r2 support?
This commit is contained in:
parent
71ae1b1aa5
commit
295b76aad2
2 changed files with 10 additions and 5 deletions
|
@ -82,6 +82,7 @@ func (db *DB) WriteUserAvatar(ctx context.Context,
|
|||
|
||||
_, err = db.minio.PutObject(ctx, db.minioBucket, "/users/"+userID.String()+"/"+hash+".webp", webp, -1, minio.PutObjectOptions{
|
||||
ContentType: "image/webp",
|
||||
SendContentMd5: true,
|
||||
})
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "uploading webp avatar")
|
||||
|
@ -89,6 +90,7 @@ func (db *DB) WriteUserAvatar(ctx context.Context,
|
|||
|
||||
_, err = db.minio.PutObject(ctx, db.minioBucket, "/users/"+userID.String()+"/"+hash+".jpg", jpeg, -1, minio.PutObjectOptions{
|
||||
ContentType: "image/jpeg",
|
||||
SendContentMd5: true,
|
||||
})
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "uploading jpeg avatar")
|
||||
|
@ -111,6 +113,7 @@ func (db *DB) WriteMemberAvatar(ctx context.Context,
|
|||
|
||||
_, err = db.minio.PutObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".webp", webp, -1, minio.PutObjectOptions{
|
||||
ContentType: "image/webp",
|
||||
SendContentMd5: true,
|
||||
})
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "uploading webp avatar")
|
||||
|
@ -118,6 +121,7 @@ func (db *DB) WriteMemberAvatar(ctx context.Context,
|
|||
|
||||
_, err = db.minio.PutObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".jpg", jpeg, -1, minio.PutObjectOptions{
|
||||
ContentType: "image/jpeg",
|
||||
SendContentMd5: true,
|
||||
})
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "uploading jpeg avatar")
|
||||
|
|
|
@ -68,6 +68,7 @@ func (db *DB) CreateExport(ctx context.Context, userID xid.ID, filename string,
|
|||
|
||||
_, err = db.minio.PutObject(ctx, db.minioBucket, de.Path(), file, int64(file.Len()), minio.PutObjectOptions{
|
||||
ContentType: "application/zip",
|
||||
SendContentMd5: true,
|
||||
})
|
||||
if err != nil {
|
||||
return de, errors.Wrap(err, "writing export file")
|
||||
|
|
Loading…
Reference in a new issue