Add size to Save function (#15264)

Fix #15253

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2021-04-03 17:19:59 +01:00 committed by GitHub
parent 3cc7d27b6f
commit 0bb8bd8190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 10 deletions

View file

@ -131,13 +131,13 @@ func (m *MinioStorage) Open(path string) (Object, error) {
}
// Save save a file to minio
func (m *MinioStorage) Save(path string, r io.Reader) (int64, error) {
func (m *MinioStorage) Save(path string, r io.Reader, size int64) (int64, error) {
uploadInfo, err := m.client.PutObject(
m.ctx,
m.bucket,
m.buildMinioPath(path),
r,
-1,
size,
minio.PutObjectOptions{ContentType: "application/octet-stream"},
)
if err != nil {