From 3a8bb518e418ad62d0ed25a580a6015ec05dbf8d Mon Sep 17 00:00:00 2001 From: Georg Spar Date: Wed, 21 Jun 2023 22:57:01 +0200 Subject: [PATCH] filename --- wdm.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wdm.go b/wdm.go index 0a659c7..381881e 100644 --- a/wdm.go +++ b/wdm.go @@ -725,9 +725,9 @@ func uploadFileHandler(writer http.ResponseWriter, req *http.Request) { if req.Form["files"] != nil { for i := 0; i < len(req.Form["files"]); i++ { - log.Info("File-Name:", req.FormValue("files[i].name")) + log.Info("File-Name:", req.FormValue("files.name")) - file, handler, err := req.FormFile("files[i]") + file, handler, err := req.FormFile("files") if err != nil { panic(err) //dont do this } @@ -758,6 +758,7 @@ func uploadFileHandler(writer http.ResponseWriter, req *http.Request) { if len(pho) == 0 { log.Fatal("Error: Size of Array = 0") writer.WriteHeader(http.StatusInternalServerError) + return } for i := 0; i < len(pho); i++ {