mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-21 20:18:47 +08:00
fix: temp file not close and incorrect WebPutAsTask
This commit is contained in:
parent
6c4736fc8f
commit
ce10c9f120
@ -5,12 +5,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/errs"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/pkg/http_range"
|
||||
"github.com/alist-org/alist/v3/pkg/utils"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
type FileStream struct {
|
||||
@ -66,6 +67,7 @@ func (f *FileStream) CacheFullInTempFile() (model.File, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f.Add(tmpF)
|
||||
f.tmpFile = tmpF
|
||||
f.Reader = tmpF
|
||||
return f.tmpFile, nil
|
||||
@ -220,6 +222,7 @@ func (ss *SeekableStream) CacheFullInTempFile() (model.File, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ss.Add(tmpF)
|
||||
ss.tmpFile = tmpF
|
||||
ss.Reader = tmpF
|
||||
return ss.tmpFile, nil
|
||||
|
@ -111,7 +111,7 @@ func FsForm(c *gin.Context) {
|
||||
},
|
||||
Reader: f,
|
||||
Mimetype: file.Header.Get("Content-Type"),
|
||||
WebPutAsTask: false,
|
||||
WebPutAsTask: asTask,
|
||||
}
|
||||
ss, err := stream.NewSeekableStream(s, nil)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user