fix upload image error [api]

This commit is contained in:
lealife
2017-01-23 17:42:38 +08:00
parent f294fa4124
commit 956e1ba2bb

View File

@ -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)