Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-31 Thread Peter Waller
I think this question is a protocol problem more than anything. A quick bit of searching "http server abort upload" reveals what to do: https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14 https://groups.google.com/forum/#!topic/golang-nuts/agB-n6V7UsQ There is also this

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Andrew
Sorry, Should be `` On Wednesday, August 30, 2017 at 8:21:05 AM UTC-7, Andrew wrote: > > Thanks all for your reply. > > I have a web page which client can upload images to Go server. My > intention is to limit each image file size to max 2M. But they can upload > multiple files at a time. > >

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Andrew
Thanks all for your reply. I have a web page which client can upload images to Go server. My intention is to limit each image file size to max 2M. But they can upload multiple files at a time. The sample can be found here: https://play.golang.org/p/0VV3s7klQu -- You received this message

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Steven Hartland
Sorry I was unclear, you are right, my intention was to identify where standard form size limiting is done for multipart/form-data POST requests. There is also a limit placed on "application/x-www-form-urlencoded" for POST requests unless the request body is already limited by MaxBytesReader,

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Lutz Horn
Limiting is done by the form parse: https://golang.org/pkg/net/http/#Request.ParseMultipartForm No, this is not limiting: The whole request body is parsed and up to a total of maxMemory bytes of its file parts are stored in memory, with the remainder stored on disk in temporary files.

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Steven Hartland
Limiting is done by the form parse: https://golang.org/pkg/net/http/#Request.ParseMultipartForm On 29/08/2017 20:40, Andrew wrote: Go 1.9 has "The new |FileHeader.Size|  field describes the size of a file in a multipart message."

Re: [go-nuts] Upload File Size Limit in Go 1.9

2017-08-30 Thread Lutz Horn
Am 29.08.2017 um 21:40 schrieb Andrew: Go 1.9 has "The new |FileHeader.Size| field describes the size of a file in a multipart message." Suppose I upload multiple files using *multiple*> Can I use FileHeader.Size to limit *each*

[go-nuts] Upload File Size Limit in Go 1.9

2017-08-29 Thread Andrew
Go 1.9 has "The new FileHeader.Size field describes the size of a file in a multipart message." Suppose I upload multiple files using Can I use FileHeader.Size to limit *each* uploaded file size? Or there's other ways? Thanks, Andrew