🎇 use tempFile to cal md5

This commit is contained in:
微凉
2022-01-27 23:48:29 +08:00
parent bf9aa5c3d3
commit b797f4302c
5 changed files with 78 additions and 7 deletions

View File

@ -249,6 +249,16 @@ func (driver Native) Upload(file *model.FileStream, account *model.Account) erro
defer func() {
_ = out.Close()
}()
//var buf bytes.Buffer
//reader := io.TeeReader(file, &buf)
//h := md5.New()
//_, err = io.Copy(h, reader)
//if err != nil {
// return err
//}
//hash := hex.EncodeToString(h.Sum(nil))
//log.Debugln("md5:", hash)
//_, err = io.Copy(out, &buf)
_, err = io.Copy(out, file)
return err
}