Return an image from asp.net web api core as IActionResult

Viewed 20311

What is the best way to return an image file as IActionResult while using asp.net web api core? I tried returning a base64 string and it works fine. But not considered as efficient. Is there a way using which we can return an image file object itself as IActionResult.

4 Answers

A File result is called FileContentResult in NET Core 3.x.

Related