Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
How can I fetch the uploaded file as FormFile and also accept the body payload using FromBody.
Example Request.cs attached.
Also what should be the root annotation in the HandleAsync() function?
5 Replies
@ardalis can you help with this... not able to find anything related to this?
Are you able to do it in a plain controller? If not then I’d work on that first. If so can you show an example with that ideally as a new GitHub issue? Thanks!
Sure, I actually am not a c# developer, just started coding it in recently and loved the endpoint's package. So not sure what you mean by plain controller. Here I am sharing the MRP and the issue while conversion.
Also have added comments on what i needed to do in the project 🙂
github issue: https://github.com/ardalis/ApiEndpoints/issues/204
GitHub
Get Payload in body as well as the uploaded File · Issue #204 · ard...
NuGet Package Version: 4.1.0 .NET SDK Version: 8 Issue is combining FromForm and FromBody not working as expected. Unable to upload file and other properties together. (Note one property type is Js...