-
Notifications
You must be signed in to change notification settings - Fork 2.1k
I met a mistake:Multipart body length limit 16384 exceeded #7019
Comments
@Tratcher any idea on this limit? |
Some multipart bodies include preamble data before the first mutipart section. MultipartReader automatically drains that portion but limits it to 16k. There's not currently a way to configure this behavior. Do you know why your upload includes a large preamble section? This is likely unintentional. |
@Tratcher parking this on your plate until we can figure out what's wrong. |
@Tratcher @Eilon |
What client are you using for the upload? An HTML form in a browser? Which browser? Can you share a Fiddler trace of the upload? From your description it contains unexpected content. |
@Tratcher This is the test code:
|
Can you save and upload that Fiddler trace? I need to see the request body. |
@Tratcher |
The request looks normal, but I see you're retrieving the boundary incorrectly.
|
@Eilon @Tratcher My code and the core of the official code is the same! Please run the test code I provided, you will find the problem, I modified the size limit, but still use the default settings. Test code(Please run it):`public class FileStreamUploadMiddleware
}` |
What @Tratcher is referring to: In the reference code you posted, contentType is already a parsed var parsedContentType = MediaTypeHeaderValue.Parse(context.Request.ContentType);
var boundary = HeaderUtilities.RemoveQuotes(parsedContentType.Boundary); You can also use the extension method |
I am sorry, I ignored this small detail, thank you very much for the patience solution. thank |
I use the middle to achieve large file upload, but encountered a mistake, I should be how to solve?
All of the settings below are invalid
The text was updated successfully, but these errors were encountered: