Skip to content

Commit

Permalink
remove temp file associated with form after uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed May 19, 2017
1 parent 6b3f0f0 commit 4d2c558
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion httpstaticserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

"regexp"

"github.com/go-yaml/yaml"
"github.com/gorilla/mux"
"github.com/shogo82148/androidbinary/apk"
"gopkg.in/yaml.v2"
)

type ApkInfo struct {
Expand Down Expand Up @@ -157,6 +157,7 @@ func (s *HTTPStaticServer) hUpload(w http.ResponseWriter, req *http.Request) {
return
}
defer file.Close()
defer req.MultipartForm.RemoveAll() // Seen from go source code, req.MultipartForm not nil after call FormFile(..)
dst, err := os.Create(filepath.Join(dirpath, header.Filename))
if err != nil {
log.Println("Create file:", err)
Expand Down

0 comments on commit 4d2c558

Please sign in to comment.