Opening a chm file from the web application

S

sunil

Hi all,
I have a web application in which I have to open a "chm" file that
exists on the local file system. I am able to open other files such as
PDF, DOC files by writing the Response's output stream.
But I do not exactly know the Response.ContentType for chm files.
I have used the following code to handle the case for chm files

System.IO.StreamReader sr = new System.IO.StreamReader(this.Path);
FileInfo file = new FileInfo(this.Path);
Response.Clear();
Response.ContentType = "application/vnd.ms-htmlhelp";
Response.WriteFile(file.FullName);
sr.Close();

But this is not opening the document.
Any help?
 
J

Juan T. Llibre

re:
But this is not opening the document.

You're entering the twilight zone. :)
That's a thorny area.

Rick Strahl has published an explanation and possible workarounds, but "the only
realistic solution seems to be to copy the help files to a local drive and run
them from there", he counsels.

http://www.west-wind.com/WebLog/posts/2928.aspx




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top