mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 22:04:06 +08:00
fix(aliyundrive_open): the temp file is not delete (close #4777)
This commit is contained in:
parent
3f7882b467
commit
6ec9a8d4c7
@ -228,6 +228,8 @@ func (d *AliyundriveOpen) upload(ctx context.Context, dstDir model.Obj, stream m
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = stream.GetReadCloser().Close()
|
||||
stream.SetReadCloser(file)
|
||||
// calculate full hash
|
||||
h := sha1.New()
|
||||
_, err = io.Copy(h, file)
|
||||
@ -260,7 +262,6 @@ func (d *AliyundriveOpen) upload(ctx context.Context, dstDir model.Obj, stream m
|
||||
if _, err = file.Seek(0, io.SeekStart); err != nil {
|
||||
return err
|
||||
}
|
||||
stream.SetReadCloser(file)
|
||||
}
|
||||
log.Debugf("[aliyundrive_open] create file success, resp: %+v", createResp)
|
||||
return d.normalUpload(ctx, stream, up, createResp, count, partSize)
|
||||
|
Loading…
x
Reference in New Issue
Block a user