I got a C# .NET Core Web API (REST). I want to implement an endpoint for upload files and one for download files (any file type, as binary). What is best practice for design and code? What I find so far by a search engine is kind of week. Do you have a recommendation for me? I guess I have to save metadata like the title (type,..?) somewhere else. Could make it easier to search for files.
At this link from microsoft I get the problem, that it seems to be only for MVC API, what I don't use.
After
[HttpPost("UploadFiles")]
public async Task<IActionResult> Post(List<IFormFile> files)
files
is empty.
And this from the c-sharpcorner does not work neater. My object file from Type IFormFile
doesn't know the method.GetFilename()
.