Is it possible to get byte[] from FileResult?

8.8k views Asked by At

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

1

There are 1 answers

3
James 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;
}