Reputation: 265
I have a method to download files with return type FileContentResult
am getting byte array from API and downloading file from that but not getting how to handle if i get null value from api.
public FileContentResult DownloadEID()
{
byte[] ContentBody = "api returns byte array";
return File(ContentBody,System.Net.Mime.MediaTypeNames.Application.Pdf,"abc.pdf");
}
but how to handle return type if i get null value from api?
Thanks
Upvotes: 1
Views: 982