This commit is contained in:
xxj
2021-06-29 17:37:25 +08:00
parent eaaf3ca560
commit 1b377a7747

View File

@@ -107,10 +107,13 @@ func (o *myFile) SaveOne(file *multipart.FileHeader) (string, error) {
// SaveOrigin 原始保存一个
func (o *myFile) SaveOrigin(file *multipart.FileHeader, dir string) (string, error) {
filename := file.Filename
_path := path.Join(o.path, dir, "/")
_path := path.Join(o.path, dir)
if o.isRelative {
_path = path.Join(tools.GetCurrentDirectory(), _path)
}
if !strings.HasSuffix(_path, "/") {
_path += "/"
}
if !tools.CheckFileIsExist(_path) {
if err := tools.BuildDir(_path); err != nil { //创建文件夹