[Download Lynx] [Resources] [Installing Lynx] [Using Lynx] [Lynx Keymap] [Using Helper Apps]
[Lynx Documentation] |
This documents describes how Lyynx calls external applications to handle files, such as graphic files, that it cannot display. Lynx uses the the extension of the file that you are downloading to determine the MIME type of that file. The MIME type is set inside the lynx.cfg file. After determining the MIME type, Lynx would look up the .mailcap file inside its home directory to see which application is needed to view the downloaded file. It then starts the helper application and passes the downloaded file to it to be displayed. The problem with this is that your programs must be in your PATH. Since it would in impractical to SET PATH to every application folder I borrowed an old DOS strategy of creating a batch file to start each program and putting them in a single location to which I set my path to. For some reason, however, shortcuts do not seem to work. 1. Create a BATCHES FolderCreate a folder in your root directory to store all the batch files. Any name will do but I would use C:\Batches for the sake of simplicity in this example. [Top]
Next you need to set your path to your C:\Batches folder. Find the autoexec.bat file in C:\. Right click on it and choose Edit to open it in Notepad. Look for the line that starts with SET PATH=... and add C:\BATCHES to the end of the line. Don't forget that entries must be separated with a semi-colon (;). On some systems, especially those not running Win9x, there may not be a autoexec.bat. In that case, create one yourself with just SET PATH=C:\BATCHES in it. [Top]
You should create a batch file for evey program that you think you would need to use to view files over the Internet, for example Acrobat Reader, an image viewer, an MP3 player. The basic structure of a batch file that you would need is as follows: @ECHO OFF [Full Path To Executable] %1 %2 %3 For example, this batch file will run Microsoft Word. @ECHO OFF C:\PROGRA~1\MICROSO~1\OFFICE\WINWORD.EXE %1 %2 %3 Note that I use the MS-DOS path (with a maximium of eight letters for each folder and file name) and not the long names. If you use the long file names be sure to enclose the entire path within quotes. The %1 %2 %3 enables you to pass switches to the program. Without them, Windows will ignore any switchs (including any files that Lynx is trying to pass to the program). The result of omitting them is that your helper app will start but not display anything. You can set your MIME type in your lynx.cfg file. Mostly, there is no need to change any of the default options but detailed instructions are included in the file itself if you wish to add a new MIME type. [Top]
The .mailcap file tells Lynx which program to use to view which MIME type. The file should be in your home directory. It should follow the format below: [MIME TYPE]; [BATCH FILE] %s This would be the entry for Microsoft Word: application/msword; winword %s Put in all your entries on their own lines and save the text file as ".MAILCAP". The problem is that both WordPad and Notepad would not let you save a file without an extension. If you do not have any other text editor other than WordPad and Notepad, use (surprise, surprise) MS-DOS EDIT. Run EDIT from your RUN dialog box in the Start Menu. [Top] |