作者 tangxvhui

调试

... ... @@ -49,7 +49,11 @@ func (c *UploadController) UploadImage() {
func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string, err error) {
savepath := filepath.Join(config.MConfig.FileSavePath, fileType)
os.MkdirAll(savepath, 0777)
err = os.MkdirAll(savepath, 0777)
if err != nil {
log.Error("目录创建失败:%s", err)
return "", err
}
file, err := fileData.Open()
defer file.Close()
if err != nil {
... ...