I am trying to display a PDF stream into a KendoUI window.
When the results are returned to the KendoUI window, the raw data of the PDF is displayed. I started Fiddler to see if the content-type is coming through correctly. Fiddler does show the proper content-type.
I have tried a number of different interactions. Each attempt yields the same result listed below.
Here is snippet from the controller:
public FileStreamResult DownloadV3()
{
//Create and populate a memorystream with the contents of the database table
MemoryStream mstream = GetPDFData();
HttpContext.Response.AddHeader("content-disposition", "attachment; filename=form.pdf");
return new FileStreamResult(mstream, "application/pdf");
}
Here is a snippet of what is displayed in KendoUI window:
%PDF-1.5 5 0 obj <>>> endobj 6 0 obj <>stream
Here is a snippet of the javascript:
<script type="text/javascript">
$(document).ready(function () {
$("#view1").bind("click", winOpen);
});
function winOpen() {
var id = '6CA88CA9-4F33-E211-84AC-B4A17689C6D9';
var kendoWindow = $("#kjWindow").kendoWindow({
title: "View File",
width: "750px",
height: "480px",
content: "/home/DownloadV3/" + id,
modal: true,
actions: ["Close", "Refresh", "Maximize"]
});
}
Any thoughts on what I am missing/
Thanks.
Steve