I have a web application (ASP.NET 4.0/C#) that allows the user to upload PDF files into the database (as Byte). When the user wants to view this PDF they select a link which calls a LoadDocument() function that returns the file in a Byte.
private void createPDF(byte file, string Name)
int fileSize = file.Length;
Response.ContentType = "application/pdf";
Name = Name + ".pdf";
Response.AddHeader("Content-Disposition", "attachment; filename="+ Name);
This was working fine, but once the website changed to SSL (it was running off of basic http for a while) I am now getting errors that say "Adobe Reader could not open 'Certificate.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
This all happened around the time that 1)The site was changed to SSL 2)The network forced an upgrade to Adobe Reader X. How can I fix this?
EDIT: I have updated the code a bit thanks to suggestions below, still no avail though.