Hi
How to set content type for pdf? I have written like this "application/pdf" , but it taking the value as "application/x-unknown ".
Please provide me solution asap.
Thanks
Gayatri
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhay ShankerRank #375 · 6.7K reputationPosted Dec 26, 2013, 1:15 AM EST
HttpApplication app
app.Context.Response.ContentType = "application/pdf";
Robbinson86 reputationPosted Dec 26, 2013, 1:44 AM EST
you just need to write
HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf");
This may resolve your issue.
Please don't forget to mark as an answer if this post help you.