473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Opening a chm file from the web application

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?

Jan 27 '07 #1
1 6315
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/
===================================
"sunil" <sa**********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
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?


Jan 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eric Caron | last post by:
Hi Here's my problem, I create a windows service with Config.xml file. All setup for my service is in this file. I create a windows application to manage these settings (Config.XML File). This...
1
by: ST | last post by:
Hi, I'm having problems opening up excel thru my code. It will write and saveas an excel file, but the application won't open on the user's computer, excel seems to be hidden, because it shows up...
4
by: David Allison | last post by:
I am looking to open my MDE Application using the DB files associated with the application I have created. My application is using a non descript three digit extension that is related to the...
28
by: Madhur | last post by:
Hello what about this nice way to open a file in single line rather than using if and else. #include<stdio.h> void main() { FILE *nd; clrscr();...
3
by: Rob Nicholson | last post by:
The following code added to Page_Load works a treat: Response.ContentType = "application/zip" Response.AppendHeader("Content-Disposition", "attachment; filename=DesktopChange.pdf")...
3
by: Ken Hall | last post by:
Is it possible to create an Excel spreadsheet using VB.NET without opening the Excel application or having to have the Excel application on the operating computer? KH
4
by: Pieter | last post by:
Hi, From my VB.NET 2005 application I need to be able to open Files an Directory's with their default application: - A word-doc must open in word - A excell-document in Excel etc - in case...
7
by: Abhi | last post by:
Hi, I want to open a File with unknown Extension using C#. What i want is i do System.Diagnostics.Process.Start("FileName"); Now if File is associated with any program then the File with open...
5
by: bimeldip | last post by:
Hi, I an tryin to create a html page where users can choose a file and open it however, i keep getting it wrong.So far this is wat i've worked on: (open.html) <html> <head> <title>Opening...
2
by: sbettadpur | last post by:
How to update the database and opening a application simultaneously. I am getting this kind of error when I click on the link for the first time. I'm using the header function to redirect the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.