Microsoft Edge has problem to show a PDF-file from a ASP.Net MVC application. Bug?

Issue #14094278 • Unassigned

Details

Author
Oscar A.
Created
Oct 5, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
15.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

I dont know if this is a bug in Microsoft Edge. Doesent work in Microsoft Edge 40.15063.0.0, Microsoft EdgeHTML 15.15063 but in other webbrowsers.

I hope someone have a answer to this problem.

I have a ASP.Net MVC application with a action in a controller that send a PDF-file as a byte array back to the webbrowser. I want this pdf-file to be opened in a new tab in the webbrowser. I dont send it back with a file name. Only the byte array and contenttype = “application/pdf”

My solution works for firefox, chrome and internet explorer 11. Microsoft edge call the controller action 5 times before it show the pdf-file in a new tab. Every time the controller action returns the correct byte data.
The other webbrowser only call the controller action 1 time before showing the pdf-file in a new tab.

The controller and action loks like this
public class PdfViewController : Controller {
[HttpGet]
public ActionResult GetPdf(int? pdfId, String TypeOfKungorelse)
{
     if(pdfId:HasValue)
     {
     // Get my pdf from a webservice. This works
     // fileData is the pdf-file as byte[], array from a database.
     // I have tried to return File(fileData, “application/pdf”) to. Same problem
     FileContentResult fcr = new FileContentResult(fileData, “application/pdf”);
          return fcr;
     }// End of if
     // If no pdfId i go to home page
    return RedirectToAction("Index", “Home”);
}// End of action
}// End of controller

I hope for a answer to this problem. Is this a bug in Microsoft edge?

Attachments

0 attachments

    Comments and activity

    Nothing to see here! No one has commented on this issue yet.

    You need to sign in to your Microsoft account to add a comment.

    Sign in