2
다음 코드를 사용하여 pdf 파일을 다시 사용자에게 보냅니다. 이것은 내 PC와 우리의 모든 테스트 PC에서 잘 작동합니다. 그러나 사용자가 문서가 손상되었다고 불평하고 있습니다. 메모장에서 보낸 pdf 파일을 보면 이진 정보 뒤에 HTML이 표시됩니다.손상된 파일을 반환하는 PDF
protected void btnGetFile_Click(object sender, EventArgs e)
{
string title = "DischargeSummary.pdf";
string contentType = "application/pdf";
byte[] documentBytes = GetDoc(DocID);
Response.Clear();
Response.ContentType = contentType;
Response.AddHeader("content-disposition", "attachment;filename=" + title);
Response.BinaryWrite(documentBytes);
}
매력적인 작품. 그것은 나를 돕고 내 문제를 해결했습니다. 고마워요 @ 존 너른 – Mehmood