Sir i have saved pdf to sql table varbinary(MAX). Now need to display it in OBJECT viewer. I searched and got a reference sample as below:
byte[] bytes = memoryStream.ToArray();
// Save pdf in the permanent location.
System.IO.File.WriteAllBytes(Server.MapPath("~/Employees/") + DateTime.Now.ToString("ddMMyyhhmmss_") + dr["EmployeeId"] + ".pdf", bytes);
// Temporary path that is used to display the pdf in the embed.
System.IO.File.WriteAllBytes(Server.MapPath("~/Files/Display.pdf"), bytes);
string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"698px\" height=\"450px\">";
embed += "If you are unable to view file, you can download from <a href = \"{0}\">here</a>";
embed += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
embed += "</object>";
ltEmbed.Text = string.Format(embed, Server.MapPath("~/Files/Display.pdf"));
memoryStream.Close();
In above sample it's saving the file to root folder but in my case i am saving it to sql table. How should I directly visible binary converted pdf in OBJECT viewer?