I get a bytearray from the database:
byte[] bytDocu;
I want to return this bytearray as File via an API:
[HttpGet]
[Route("GetFile/{key}")]
public IHttpActionResult GetFile(int key)
{
try
{
byte[] bytDocu = _documentService.getFile(key);
return Ok(result);
}
catch (Exception e)
{
return BadRequest(e.Message);
}
}
How do I turn the Bytearray into a File? And how do I hand it to the Ok()-function?
Thanks for your help :)