クロムで開いたpdfファイルを取得しようとしましたが、表示中に途中で止まってしまったようです。 PDF表示がブラウザが正しく見えるインライン作るためにCHROME&FireBoxを使用してファイルをダウンロードするのではなく、ブラウザでファイルを開くようにしてください。
public void GetViewFileData(string attachmentID)
{
List<DownloadFileInfoViewModel> retDownloadFilesInfo = new List<DownloadFileInfoViewModel>();
using (var context = this.GetContext())
{
retDownloadFilesInfo = context.GetfileData(attachmentID);
}
// Clear the content of the response
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=" + retDownloadFilesInfo[0].FileName);
HttpContext.Current.Response.AddHeader("Content-Length", retDownloadFilesInfo[0].FileSize.ToString());
HttpContext.Current.Response.ContentType = ReturnExtension(retDownloadFilesInfo[0].FileExt.ToLower());
HttpContext.Current.Response.BinaryWrite(retDownloadFilesInfo[0].FileData);
HttpContext.Current.Response.Flush(); // this make stream and without it open
HttpContext.Current.ApplicationInstance.CompleteRequest();
HttpContext.Current.Response.End();
}
何ファイルの種類はそれですか? – mrtig