Author: patientd1 | Posted on: 7/30/2010 10:57:32 AM | Views : 293

I have pdf files saved on the file server. When I pass those files to the client as an attachment in the email They open fine, but when I pass it using this code on my client portal at the a button click, it gets curropted and the client get error on opening. The client portal uses https. What changes can I make to my download code inorder to make download not currupt my pdf file.

This code runs to start save as dialogue when download button is clicked:

Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment; filename=" + FName); FileStream sourceFile = new FileStream(TargetFile, FileMode.Open); long FileSize; FileSize = sourceFile.Length; byte[] getContent = new byte[(int)FileSize]; sourceFile.Read(getContent, 0, (int)sourceFile.Length); sou ...

Go to the complete details ...