title: ASPNetCore - Uploading a file through REST
body: <p>I am using Insomnia for testing an API, but the same happens with Postman.</p>
  
  <p>I want to test a file upload, with the following controller:</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; Post([FromForm]IFormFile File)
  </code></pre>
  
  <p>If I set the request as a multipart request:</p>
  
  <p><a href="https://i.stack.imgur.com/GAUcv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GAUcv.png" alt="enter image description here"></a></p>
  
  <p>it works.</p>
  
  <p>However, if I set it as a binary file:</p>
  
  <p><a href="https://i.stack.imgur.com/mGexu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mGexu.png" alt="enter image description here"></a></p>
  
  <p>I don't know how to get the data. How can it be done?</p>
  
  <p>Also, in the controller method's signature, if I change [FromForm] to [FromBody], I'm not getting data.</p>
  
  <p>Can someone clarify this for me?</p>