From cedf8ef84ad82fea0f2e4e1f79f30695df9aea31 Mon Sep 17 00:00:00 2001 From: Jimmy99 Date: Wed, 6 Apr 2016 07:18:28 +0200 Subject: [PATCH] Update 04.5.md Typographical errors and improved readability --- en/04.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/04.5.md b/en/04.5.md index bbc62ef7..0f824fe0 100644 --- a/en/04.5.md +++ b/en/04.5.md @@ -66,7 +66,7 @@ func upload(w http.ResponseWriter, r *http.Request) { ``` -As you can see, we need to call `r.ParseMultipartForm` for uploading files. The function `maxMemory` argument. After you call `ParseMultipartForm`, the file will be saved in the server memory with `maxMemory` size. If the file size is larger than `maxMemory`, the rest of the data will be saved in a system temporary file. You can use `r.FormFile` to get the file handle and use `io.Copy` to save to your file system. +As you can see, we need to call `r.ParseMultipartForm` for uploading files. The function ParseMultipartForm takes the `maxMemory` argument. After you call `ParseMultipartForm`, the file will be saved in the server memory with `maxMemory` size. If the file size is larger than `maxMemory`, the rest of the data will be saved in a system temporary file. You can use `r.FormFile` to get the file handle and use `io.Copy` to save to your file system. You don't need to call `r.ParseForm` when you access other non-file fields in the form because Go will call it when it's necessary. Also, calling `ParseMultipartForm` once is enough -multiple calls make no difference.