How create a MultipartFormFormatter for ASP.NET 4.5 Web API

前端 未结 2 964
野性不改
野性不改 2020-12-18 14:11

These links didn\'t help me:

  • Way 1
  • Way 2

Example:

//Model:
public class Group
{
    public int Id { get; set; }                 


        
2条回答
  •  没有蜡笔的小新
    2020-12-18 15:09

    Please see below link for detail implementation: https://github.com/iLexDev/ASP.NET-WebApi-MultipartDataMediaFormatter

    Nuget: https://www.nuget.org/packages/MultipartDataMediaFormatter/

    I actually need to do "multipart/form-data" file upload and model binding today, I tried above lib from nuget and turns out it works as my expectation. Validation on model also works fine. Hopefully it helps to answer your question.

提交回复
热议问题