mirror of
https://github.com/xxjwxc/public.git
synced 2025-09-26 20:01:19 +08:00
new
This commit is contained in:
@@ -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 { //创建文件夹
|
||||
|
Reference in New Issue
Block a user