daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func upload(w http.ResponseWriter, r *http.Request) {
  2.  
  3.     if r.Method == "GET" {
  4.         t := template.New("xx")
  5.         t, err := t.Parse(html)
  6.  
  7.         if err != nil {
  8.             log.Fatalf("failed to update template: %s", err)
  9.         }
  10.  
  11.     }
  12.     if r.Method == "POST" {
  13.         err := r.ParseMultipartForm(1024 * 65)
  14.  
  15.         if err != nil {
  16.  
  17.             fmt.Println(err)
  18.             return
  19.         }
  20.  
  21.         // ... gathering data, doing stuff ...
  22.  
  23.         data := processData()
  24.         // TODO: pass data to use it in the result page
  25.  
  26.         http.Redirect(w, r, "/result", http.StatusSeeOther)
  27.  
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top