IFormFile always return null in asp.net core 2.1

前端 未结 11 1853
伪装坚强ぢ
伪装坚强ぢ 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:12

    Update [FromForm] attribute, and don't put parameter into Headers, and put name of key is file and brandId.

    I tested, It is Ok

提交回复
热议问题