diff --git a/main.go b/main.go index beade32..f135922 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,11 @@ func uploadFile(w http.ResponseWriter, r *http.Request) { log.Printf("Error happened receiving file: %v\n", err) } + _, err = os.Stat("./temp/") + if os.IsNotExist(err) { + os.Mkdir("./temp/", 0700) + } + f, err := os.OpenFile("./temp/"+header.Filename, os.O_WRONLY|os.O_CREATE, 0660) if err != nil { log.Printf("Error happened opening file: %v\n", err)