Category / Section
How to resolve the unsupported media type error on loading image in ASP.NET Core
Published:
Updated:
Unsupported media type error occurs on the loading image in the Report Viewer and Report designer because of the ApiController
attribute. This attribute will not allow for file byte content. You can resolve the error by following these steps.
Remove the
[ApiController]
attribute in your controller because it is not supported to get the image from API.Then add the
[FromBody]
attribute with the PostReportAction action as shown below because we have removed the ApiController attribute from the controller.
See also
Display ssrs rdl report in Bold Reports ASP.NET Core Report Viewer