hotfix: 临时修复文件扩展名识别错误的问题
This commit is contained in:
父節點
29ea61034a
當前提交
2d14222073
@ -1,10 +1,10 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"integrity-checkin/data/po"
|
"integrity-checkin/data/po"
|
||||||
"integrity-checkin/pkg/app"
|
"integrity-checkin/pkg/app"
|
||||||
"integrity-checkin/pkg/util"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -116,9 +116,10 @@ func (c CheckinService) UploadFile(aw *app.Wrapper) app.Result {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return aw.Error(err.Error())
|
return aw.Error(err.Error())
|
||||||
}
|
}
|
||||||
if err = util.ValidateFilename(formFile.Filename); err != nil {
|
fmt.Println(formFile.Filename)
|
||||||
return aw.Error(err.Error())
|
//if err = util.ValidateFilename(formFile.Filename); err != nil {
|
||||||
}
|
// return aw.Error(err.Error())
|
||||||
|
//}
|
||||||
if _, err = os.Stat("files"); err != nil {
|
if _, err = os.Stat("files"); err != nil {
|
||||||
err = os.Mkdir("files", 0666)
|
err = os.Mkdir("files", 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
載入中…
x
新增問題並參考
Block a user