IFormFile always return null in asp.net core 2.1

前端 未结 11 1846
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 11:52

Api method is looks like below

    [HttpPost]
    public async Task> MediaBrand(IFormFile file, int brandId)
         


        
11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-11 12:30

    I have found a workaround to make it work:

    Use HttpPut instead of HttPost on the controller action.

    I was also surprised by this behavior. If someone can explain why it fixes the issue, it would help me.

提交回复
热议问题