How to create an API controller that will handles multipart/data

Dondon510 221 Reputation points
2024-11-23T08:36:20.2266667+00:00

Hello,

I use ASP NETCore 6, How to create an API controller that will handles multipart/data with the following keys:

tifFile --> File

hostName --> string

accessCode --> string

I tried the following using postman, it goes there but I don't have an idea on how to extract the key and its value?

[HttpPost]
[Route("/api/AWS/Upload")]
[AllowAnonymous]
public async Task awsUploadAsync() 
{
    // how to get the tifFile, hostName, and accessCode value here
}

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,645 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.