Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling .chm file from applet

 
Elizabeth Luckose
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to display a help file(.chm file) from my japplet.I tried using
getAppletContext().showDocument(url). The url points to where the chm file is located
url=new URL("http://localhost:8100/integrail/Artgalry.chm");
But what get displayed is only the binary coded stuff. How can I display the file? Should I need to install anything and configure?
Please help
Elizabeth
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CHM is the hypertext form of help file used by the more recent versions of Windows, isn't it?
Anyway, the default disposition of any file retrieved by a web browser is determined by the MIME handlers it has been set up with. In Microsoft Internet Explorer, this information is the same as what Windows itself uses, and it's buried pretty deep inside the Windows Registry. Which means that an unsigned applet can't do anything about it. In any event, CHM would only work for a company intranet where all users are known to be running 32-bit Windows - it's not supported by Windows V3, Macintoshes, or Linux.
There's 3 possibilities I can think of - short of doing something to each and every computer that will be accessing the CHM.
1. Set the content-disposition header so that CHM is downloaded as a file rather than having the browser try and display it. In other words, make them save a local copy and run it manually. Yuckky, but it's the only way I know that actually lets you use that file.
2. Convert the CHM to a set of web pages. Depending on who put the CHM together this may or may not be fairly easy to do. It's also good if the helpfile author didn't put in any macros, since they won't run in a webpage environment.
3. Convert the CHM to a JavaHelp file. This gets you closer to what you were actually looking for, but it's more work not only for you but for the helpfile author.
Of the 3 solutions I've given, the most common one used in everyday practice is #2, since it has the most portability - the client doesn't even need Java - and HTML skills are easily come by. Some help authoring tools such as RoboHelp will even allow you do do both HTML and CHM from a single project, I believe.
 
asmar asmar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IS it possible to open the chm file without the browser asking me if i want to open or save the document?
Thanks
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by asmar asmar:
IS it possible to open the chm file without the browser asking me if i want to open or save the document?
Thanks

Yes, if your computer has the appropriate MIME settings. Which, unfortunately under Windows tend to be in various obscure places.
You might also want to look at the specs for the "Content-Disposition" header.
That has nothing to do with applets, BTW, it's a basic HTML feature. No Java required.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic