Skip to content

Commit

Permalink
chore: uncomment the code (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy committed May 27, 2020
1 parent 1e7867f commit 7e8c3a0
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions content/en/docs/examples/upload-file/multiple-file.md
Expand Up @@ -9,7 +9,7 @@ See the detail [example code](https://github.com/gin-gonic/examples/tree/master/
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// Multipart form
form, _ := c.MultipartForm()
Expand All @@ -19,7 +19,7 @@ func main() {
log.Println(file.Filename)

// Upload the file to specific dst.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/examples/upload-file/single-file.md
Expand Up @@ -13,14 +13,14 @@ References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// single file
file, _ := c.FormFile("file")
log.Println(file.Filename)

// Upload the file to specific dst.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)

c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
Expand Down
4 changes: 2 additions & 2 deletions content/ja/docs/examples/upload-file/multiple-file.md
Expand Up @@ -9,7 +9,7 @@ draft: false
func main() {
router := gin.Default()
// マルチパートフォームが利用できるメモリの制限を設定する(デフォルトは 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// マルチパートフォーム
form, _ := c.MultipartForm()
Expand All @@ -19,7 +19,7 @@ func main() {
log.Println(file.Filename)

// 特定のディレクトリにファイルをアップロードする
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
Expand Down
4 changes: 2 additions & 2 deletions content/ja/docs/examples/upload-file/single-file.md
Expand Up @@ -13,14 +13,14 @@ issue [#774](https://github.com/gin-gonic/gin/issues/774) と、詳細は [サ
func main() {
router := gin.Default()
// マルチパートフォームが利用できるメモリの制限を設定する(デフォルトは 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// 単一のファイル
file, _ := c.FormFile("file")
log.Println(file.Filename)

// 特定のディレクトリにファイルをアップロードする
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)

c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
Expand Down
4 changes: 2 additions & 2 deletions content/ko-kr/docs/examples/upload-file/multiple-file.md
Expand Up @@ -9,7 +9,7 @@ draft: false
func main() {
router := gin.Default()
// 멀티파트 폼에 대한 최저 메모리 설정 (기본값 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// 멀티파트 폼
form, _ := c.MultipartForm()
Expand All @@ -19,7 +19,7 @@ func main() {
log.Println(file.Filename)

// 특정 경로(dst)에 파일을 업로드 합니다.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
Expand Down
4 changes: 2 additions & 2 deletions content/ko-kr/docs/examples/upload-file/single-file.md
Expand Up @@ -13,14 +13,14 @@ draft: false
func main() {
router := gin.Default()
// 멀티파트 폼에 대한 최저 메모리 설정 (기본값 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// 단일 파일
file, _ := c.FormFile("file")
log.Println(file.Filename)

// 특정 경로(dst)에 파일을 업로드 합니다.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)

c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
Expand Down
4 changes: 2 additions & 2 deletions content/zh-cn/docs/examples/upload-file/multiple-file.md
Expand Up @@ -9,7 +9,7 @@ draft: false
func main() {
router := gin.Default()
// 为 multipart forms 设置较低的内存限制 (默认是 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// Multipart form
form, _ := c.MultipartForm()
Expand All @@ -19,7 +19,7 @@ func main() {
log.Println(file.Filename)

// 上传文件至指定目录
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
Expand Down
4 changes: 2 additions & 2 deletions content/zh-cn/docs/examples/upload-file/single-file.md
Expand Up @@ -9,14 +9,14 @@ draft: false
func main() {
router := gin.Default()
// 为 multipart forms 设置较低的内存限制 (默认是 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// 单文件
file, _ := c.FormFile("file")
log.Println(file.Filename)

// 上传文件至指定目录
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)

c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
Expand Down
4 changes: 2 additions & 2 deletions content/zh-tw/docs/examples/upload-file/multiple-file.md
Expand Up @@ -9,7 +9,7 @@ See the detail [example code](examples/upload-file/multiple).
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// Multipart form
form, _ := c.MultipartForm()
Expand All @@ -19,7 +19,7 @@ func main() {
log.Println(file.Filename)

// Upload the file to specific dst.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)
}
c.String(http.StatusOK, fmt.Sprintf("%d files uploaded!", len(files)))
})
Expand Down
4 changes: 2 additions & 2 deletions content/zh-tw/docs/examples/upload-file/single-file.md
Expand Up @@ -9,14 +9,14 @@ References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail
func main() {
router := gin.Default()
// Set a lower memory limit for multipart forms (default is 32 MiB)
// router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.MaxMultipartMemory = 8 << 20 // 8 MiB
router.POST("/upload", func(c *gin.Context) {
// single file
file, _ := c.FormFile("file")
log.Println(file.Filename)

// Upload the file to specific dst.
// c.SaveUploadedFile(file, dst)
c.SaveUploadedFile(file, dst)

c.String(http.StatusOK, fmt.Sprintf("'%s' uploaded!", file.Filename))
})
Expand Down

0 comments on commit 7e8c3a0

Please sign in to comment.