Browse Source

Small fixes

master
William Davis 9 months ago
parent
commit
d072e37242
  1. 9
      main.go

9
main.go

@ -6,7 +6,7 @@ import (
"net/http"
)
func uploader(r *http.Request) {
func uploader(w http.ResponseWriter, r *http.Request) {
//i left this out to see what would happen
//r.ParseMultipartForm(10 << 20)
@ -18,9 +18,9 @@ func uploader(r *http.Request) {
return
}
defer file.Close()
fmt.Printf("Uploaded File: %+v\n", handler.Filename)
fmt.Printf("File Size: %+v\n", handler.Size)
fmt.Printf("MIME Header: %+v\n", handler.Header)
fmt.Printf("Uploaded File: %+v\n", header.Filename)
fmt.Printf("File Size: %+v\n", header.Size)
fmt.Printf("MIME Header: %+v\n", header.Header)
tmp, err := ioutil.TempFile("img","upload-*.png")
//MAKE img DIRECTORY
if err != nil {
@ -36,6 +36,7 @@ func uploader(r *http.Request) {
func server() {
http.HandleFunc("/upload", uploader)
fmt.Println("Listening on :8080...")
http.ListenAndServe(":8080", nil)
}

Loading…
Cancel
Save