mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-22 08:38:30 -04:00
Add size to Save function (#15264)
Fix #15253 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
3cc7d27b6f
commit
0bb8bd8190
7 changed files with 17 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue