Browse Source

filename

pull/1/head
Georg Spar 1 year ago
parent
commit
3a8bb518e4
  1. 5
      wdm.go

5
wdm.go

@ -725,9 +725,9 @@ func uploadFileHandler(writer http.ResponseWriter, req *http.Request) {
if req.Form["files"] != nil { if req.Form["files"] != nil {
for i := 0; i < len(req.Form["files"]); i++ { 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 { if err != nil {
panic(err) //dont do this panic(err) //dont do this
} }
@ -758,6 +758,7 @@ func uploadFileHandler(writer http.ResponseWriter, req *http.Request) {
if len(pho) == 0 { if len(pho) == 0 {
log.Fatal("Error: Size of Array = 0") log.Fatal("Error: Size of Array = 0")
writer.WriteHeader(http.StatusInternalServerError) writer.WriteHeader(http.StatusInternalServerError)
return
} }
for i := 0; i < len(pho); i++ { for i := 0; i < len(pho); i++ {

Loading…
Cancel
Save