File upload with ASP.Net Core 2.0 Web API and React.js

后端 未结 4 521
忘了有多久
忘了有多久 2021-02-03 13:30

I\'m new to both react.js and ASP.Net core 2.0. And now writing a project using ASP.Net core 2.0 as back end API and react.js as application interface (front end). I\'d like to

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-03 13:56

    This answer is true but I have problem with saving an image in my API so I change the method as you see and then work nice. You should set the parameter as [FromForm] in your API method

    public async Task Upload([FromForm]FileUploadViewModel model){...}
    

提交回复
热议问题