![]() |
All documents that are published by the LabVIEW web server must be located in the web server's root directory. By default, the server's root directory is the www directory located in LabVIEW's directory. You can change the root directory in the "Web Server: Configuration" page of the Preferences dialog.
When you save a document to the web server's root directory, you'll be able to retrieve it using a corresponding URL. A URL tells a browser what server to connect to, it also tells the server which document to return. URLs to documents retrieved from the LabVIEW web server will be in the following format:
http://host.domain.com/path/to/document.htm
http://host.domain.com:8000/path/to/document.htm
For example, if the root directory on a Windows computer is C:\LabVIEW\www, then the string /path/to/document.htm will specify the file C:\LabVIEW\www\path\to\document.htm.
The URL to your document will begin with http:// followed by the Internet address of your computer. If your server is using a port other than 80, you will follow this with colon ':' and the port number. Finally you will append the URL file path.
To determine the URL path of a file in your root directory, simply take the file path, ignore the part at the beginning of the path that is the same as you root directory. Then change the path separator characters (Windows '\', Macintosh ':', Unix '/') to the URL path separator character '/'.
If the converted file path contains any special characters (such as spaces, special punctuation marks, characters with accents) you must encode them according to URL conventions. Each special character should be replaced by %xx, where xx is the hexadecimal value of the character. For example, the file name "Experiment Page.htm" will be encoded as "Experiment%20Page.htm", since 20 is the hexadecimal value of the space character.
Note: If you only use ASCII letters and number and avoid spaces in your file and directory names, you don't have to worry about encoding special characters.
The most common text document format on the web is HTML. You can create HTML documents using an HTML editor (you can download shareware HTML editors from the web). Many word processor applications, such as WordPerfect or Microsoft Word allow you to save documents in HTML format as well.
When you save an HTML document, make sure that it has an .htm or .html file name extension.
The most common image formats on the web are JPEG and GIF. Another more recent web image format is PNG, however, it is not supported by older browsers. Many image editing programs allow you to save images in on one of the web image formats. You can also use utilities to convert Windows .BMP files or Macintosh PICT files to a web image file.
When you save an image file in a web format, make sure that is has the appropriate (.gif, .jpg, .jpeg, or .png) file name extension.
When a URL ends with a slash '/' (i.e. http://host.domain.com/tests/) it specifies a directory, rather than a file. In this case the web server will return the file index.htm located in this directory (if it exists). In other words, the server will automatically append index.htm to the URL (i.e. http://host.domain.com/tests/index.htm).
It is a good idea to have an index.htm file located in your root directory. This way anyone connecting to your machine (using a URL such as http://host.domain.com) will receive a valid document.
© National Instruments |