0

I form data into a form for angular like this:

const formDate = new FormData();
formDate.append("restaurant", JSON.stringify(this.restaurant));
formDate.append("file", this.file[0], this.file[0].name);

I can see through the developer panel in the browser that the form is submitting the correct data: enter image description here

But the controller accepts such data, and the file arrives normally: enter image description here

Controller:

  [HttpPost, DisableRequestSizeLimit]
  public IActionResult Post([FromForm]Restaurant restaurant, [FromForm]IFormFile file)
  {
    code...
  }
2
  • Are you able to manually POST data to your web api endpoint via postman or fiddler? Commented Jun 2, 2021 at 13:49
  • See stackoverflow.com/questions/45017720/… Commented Jun 2, 2021 at 13:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.