Created
April 24, 2016 15:17
-
-
Save sofyan-ahmad/f087e2b7f1a2f5839e6bbe0bb4abbc6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r.ParseMultipartForm(32 << 20) | |
file, handler, err := r.FormFile("userphoto") | |
utils.HandleWarn(err) | |
defer file.Close() | |
fmt.Fprintf(w, "%v", handler.Header) | |
f, err := os.OpenFile("./uploads/user_avatars/"+handler.Filename, os.O_WRONLY|os.O_CREATE, 0666) | |
utils.HandleWarn(err) | |
defer f.Close() | |
io.Copy(f, file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment