Feat: support apply append mode and overwrite mode for FileStream
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/util"
|
||||
)
|
||||
|
||||
@@ -107,7 +106,7 @@ func (job *CompressTask) Do() {
|
||||
job.TaskModel.SetProgress(TransferringProgress)
|
||||
|
||||
// 上传文件
|
||||
err = fs.UploadFromPath(ctx, zipFile, job.TaskProps.Dst, true, fsctx.Create)
|
||||
err = fs.UploadFromPath(ctx, zipFile, job.TaskProps.Dst, true, 0)
|
||||
if err != nil {
|
||||
job.SetErrorMsg(err.Error())
|
||||
return
|
||||
|
||||
@@ -119,7 +119,6 @@ func (job *TransferTask) Do() {
|
||||
|
||||
err = fs.Handler.Put(context.Background(), &fsctx.FileStream{
|
||||
File: file,
|
||||
Mode: fsctx.Create,
|
||||
SavePath: job.Req.Dst,
|
||||
Size: uint64(size),
|
||||
})
|
||||
|
||||
@@ -123,11 +123,10 @@ func (job *TransferTask) Do() {
|
||||
Size: job.TaskProps.SrcSizes[file],
|
||||
Name: path.Base(dst),
|
||||
VirtualPath: path.Dir(dst),
|
||||
Mode: fsctx.Create,
|
||||
})
|
||||
} else {
|
||||
// 主机节点中转
|
||||
err = fs.UploadFromPath(context.Background(), file, dst, true, fsctx.Create)
|
||||
err = fs.UploadFromPath(context.Background(), file, dst, true, 0)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user