From 956e1ba2bbf35cbe7cffac9a59f4959d9d6b124a Mon Sep 17 00:00:00 2001 From: lealife Date: Mon, 23 Jan 2017 17:42:38 +0800 Subject: [PATCH] fix upload image error [api] --- app/controllers/api/ApiBaseController.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/ApiBaseController.go b/app/controllers/api/ApiBaseController.go index e0b8e34..4d32d8c 100644 --- a/app/controllers/api/ApiBaseController.go +++ b/app/controllers/api/ApiBaseController.go @@ -142,10 +142,10 @@ func (c ApiBaseContrller) upload(name string, noteId string, isAttach bool) (ok // 生成新的文件名 filename := handel.Filename _, ext := SplitFilename(filename) - if ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg" { - msg = "notImage" - return - } + // if ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg" { + // msg = "notImage" + // return + // } filename = newGuid + ext data, err := ioutil.ReadAll(file)