finish teambition chunk upload

pull/548/head
微凉 2022-01-26 14:05:35 +08:00
parent df513b7dc0
commit c70fc3fc4b
2 changed files with 9 additions and 2 deletions

View File

@ -273,8 +273,8 @@ func (driver Teambition) Upload(file *model.FileStream, account *model.Account)
newFile, err = driver.upload(file, token, account)
} else {
// chunk upload
err = base.ErrNotImplement
//newFile, err = driver.chunkUpload(file, token, account)
//err = base.ErrNotImplement
newFile, err = driver.chunkUpload(file, token, account)
}
if err != nil {
return err

View File

@ -209,6 +209,13 @@ func (driver Teambition) chunkUpload(file *model.FileStream, token string, accou
return nil, err
}
}
res, err := base.RestyClient.R().SetHeader("Authorization", token).Post(
fmt.Sprintf("https://%s.teambition.net/upload/chunk/%s",
prefix, newChunk.FileKey))
log.Debug(res.Status(), res.String())
if err != nil {
return nil, err
}
return &newChunk.FileUpload, nil
}