Make Golang correctly delete temp files during uploading (#36128)

Fix #36127
This commit is contained in:
wxiaoguang authored and GitHub committed 2025-12-11 19:59:42 +01:00
1 parent 01351cc6c7
commit f25409fab8
7 files changed
+57 -11

No files matched your search

+3 -1
View File
@@ -43,8 +43,10 @@ type Base struct {
Locale translation.Locale
}
var ParseMultipartFormMaxMemory = int64(32 << 20)
func (b *Base) ParseMultipartForm() bool {
err := b.Req.ParseMultipartForm(32 << 20)
err := b.Req.ParseMultipartForm(ParseMultipartFormMaxMemory)
if err != nil {
// TODO: all errors caused by client side should be ignored (connection closed).
if !errors.Is(err, io.EOF) && !errors.Is(err, io.ErrUnexpectedEOF) {