I have a FileController
with an endpoint to upload one file by using a custom data type (I need some more data in addition to the file).
[HttpPost]
public async Task<IActionResult> UploadFile([FromForm] FileUploadDto fileUploadDto, [FromQuery] bool verbose)
{
// do stuff
return Ok(await fileCoordinator.Process(fileUploadDto, connectionInfo, verbose));
}
FileUploadDto
has a member IFormFile File
and 4 additional required string members.
I already checked Radzen Upload examples but the example Controller only accepts one IFormFile
argument. I understand that it's possible to add additional query parameters and headers but I haven't found any info about using a custom type.
Another idea was to not call the endpoint, construct a FileUploadDto
and directly call my FileCoordinator
class in the Blazor page. But using RadzenUpload
component without Url yields a FileInfo
which cannot be converted into a IFormFile
.
So, is there a way to use RadzenUpload
with an endpoint that accepts a custom data type?