作者 唐旭辉

调整文件存储

... ... @@ -58,7 +58,7 @@ func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string,
}
subfix := path.Ext(fileData.Filename)
mfileName := fmt.Sprint(utils.GenerateIDBySonyflake())
mfileName = fmt.Sprintf("%d_%s.%s", time.Now().Unix(), mfileName, subfix)
mfileName = fmt.Sprintf("%d_%s%s", time.Now().Unix(), mfileName, subfix)
log.Debug("文件保存地址%s", filepath.Join(savepath, mfileName))
dst, err := os.Create(filepath.Join(savepath, mfileName))
defer dst.Close()
... ...