Open flykarry opened 3 years ago
Hello @flykarry,
There is no a builtin feature like this, I think it will be better if you have just opened this issue at https://github.com/golang/go, as the underline functionality we use to receive uploaded files derived from net/http package (otherwise we would have to duplicate a lot of code for such a feature). However, I assume you can use a rate limiter/a throttler for that (like we do on ServeContentWithRate(content io.ReadSeeker, filename string, modtime time.Time, limit float64, burst int) to send files to the client) , but you have to parse the body correctly as net/http does ( per HTTP/1.1 and 2.0 specification). This is a good feature request but, I don't think that's the right moment as we will ship the v12.2.0 stable release soon.
I will leave this feature request open so we can get feedback from other developers too, maybe we'll find time for that, but I can't promise you anything yet.
https://www.threeaccents.com/posts/handling-large-file-uploads-in-go may be helpful for you @flykarry
Is your feature request related to a problem? Please describe. when I upload a large files ,It's may cost too large memory
Describe the solution you'd like separate the file with many chunk upload, and then merge and save
Describe alternatives you've considered nothing
Additional context nothing