.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

open docx in asp.net

Posted By: Sandhya     Posted Date: October 15, 2010    Points:2   Category :ASP.Net
I have a requirement of opening the docx file in the browser. Tried with the code below. But error occurs that the file is corrupt. Is the content type correct, tried with thecontent type application/msword also.

Response.AddHeader("content-disposition", "inline;filename=" + DisplayFileName);
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";//getContentType(filename);
Response.WriteFile(fullpath);
Response.End();
Response.Flush();

The code works for all other file types when the appropriate content type is given. The problem is only with docx.


Responses
Author: Sajid P K             
Posted Date: October 18, 2010     Points: 5   

Sandhya ,

please Check follwing link.. May be helpfull.

http://forums.asp.net/p/1599094/4062552.aspx



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend