Connecting Tech Pros Worldwide Help | Site Map

Opening a chm file from the web application

sunil
Guest
 
Posts: n/a
#1: Jan 27 '07
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?

Juan T. Llibre
Guest
 
Posts: n/a
#2: Jan 27 '07

re: Opening a chm file from the web application


re:
Quote:
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/
===================================
"sunil" <sairaj.sunil@gmail.comwrote in message
news:1169877014.231701.153670@q2g2000cwa.googlegro ups.com...
Quote:
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?
>


Closed Thread


Similar ASP.NET bytes