TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Naresh Babu Gopavaram
1.5k
248
249.9k
Error while retriving the pdf file from sqlserver DB
Aug 5 2011 1:04 AM
I am saving the pdf file in sqlserver as bytes .When i am trying to retrive and show the file does not shows the content the following error occures
there was an error opening this document the file is damaged and could not be repaired +asp.net
Please any one help me
This is for save
byte[] byteArray = System.IO.File.ReadAllBytes(Server.MapPath("Deal//UI//pdfSample.pdf"));
savetoDB();
Retriving
byte[] document = (byte[])offer.OfferPdf;
//string strExtenstion = ".pdf";
string DocName = "pdfSample";
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment;filename=" + DocName + ".pdf");
Response.AddHeader("content-length", document.Length.ToString());
Response.ContentType = "application/pdf";
//Response.TransmitFile("pdfSample.pdf");
Response.BinaryWrite(document);
//Response.Charset = "";
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
//Response.Write(document);
Response.End();
Reply
Answers (
7
)
How to use bengali language in web site
Bind grid view using json