WE are running into an issue where a file is not getting downloaded correctly when hosted as an AWS lambda package.
.Net Core API GET Endpoint that returns
[HttpGet()]
[Route("ABC")]
public async Task<IActionResult> ABC(string id)
{ byte[] con = GetFileContent(id);
var fileName = GetFileName(id);
return File(con, "application/octet-stream", filename);
}
When we run this on local host (IISExpress) this return the file with content
But when the same is build into an AWS lambda package and deployed, it downloads the file but the file does not open and gives error as corrouted, etc
Do we need to set something in lambda to allow this download to work correctly?
Also, when we run this on POSTMan
on Local: it Returns the file in Response(Encoded- File with strange characters) On Dev: It returns the byte[]??