fix 大文件上传路径修复

This commit is contained in:
yxh 2023-09-12 22:20:14 +08:00
parent f4973d2170
commit 1e8ba1a62e
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package upload_chunk
const (
Tmp = "./resource/public/big_file/" // 文件保存目录
RelativePath = "big_file/" // 返回前端的相对路径
FileName = "upfile" // 上传文件的文件名
)

View File

@ -3,6 +3,8 @@ package upload_chunk
import (
"errors"
"fmt"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
"io"
"log"
"mime/multipart"
@ -207,7 +209,7 @@ func (u *UploadChunk) Upload(uploadReq UploadReq) (result *UpLoadRes, err error)
}
func (u *UploadChunk) Tmp() string {
return Tmp
return g.Cfg().MustGet(gctx.New(), "server.serverRoot").String() + "/big_file/" // 文件保存目录
}
// 合并文件