0

Checking the ASP.NET Core built-in formatters there seems to be no multipart formatter. Yet a multipart request is model bound, so there needs to be some kind of input formatter, that creates the key-value pairs, which are then model bound. Which formatter is that?

stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270

1 Answers1

1

Model is bound during model binding. Model binder in its turn uses IValueProvider to get values from request. There is FormValueProvider for multipart content, which in its turn gets values from FormValueProviderFactory provided by request.ReadFormAsync() call. Default implementation of HttpRequest redirects the call to FormFeature's ReadFormAsync. So you can find all the logic for reading multipart content values there.

Alexander
  • 9,104
  • 1
  • 17
  • 41