Is it possible to get byte[] from FileResult?

8.7k Views Asked by At

Is it possible to get byte[] from FileResult in C#?

1

There are 1 best solutions below

3
On BEST ANSWER

FileResult is an abstract class so that won't be the underlying instance type - assuming the correct overload is used then you should be able to cast it to a FileContentResult

if (result is FileContentResult data)
{
    var content = data.FileContents;
}