logo

New Response

« Return to the main article

You are replying to:

  1. You can also use this technique to create other kinds or responses besides HTML. The important thing to remember is that you need to change the Content-Type also known as MIME type. For example, this line:

    Print "Content-Type:text/html"

    would change to this for Excel:

    Print "Content-Type:application/vnd.ms-excel"

    Then instead of writing out HTML, you can write out comma seperated text and Excel will launch and convert it. It's a really slick way to exporting to Excel from the web; One that I stole from my credit card company. They're not using Notes, but the principle is the same.

    If you want to get really complicated, you could have your agent write out a binary transfer to the browser. This is how you would use an agent to create a picture. You could use this to search and return scanned documents from another system (although there would probably be an easier way). I've only done this in Java and can't find the code anymore. But, you just read in a binary file (in my case from our imaging system) and print it out to the browser in binary form. Of course, the Content-Type is still set with text, as follows:

    Print "Content-Type:image/gif"

    Most web servers have a configuration file called mime.types or mime.properties or mime.cfg or mime.ini or something like that. If you look at that file you can tell what your options are. Most are obvious and have the program name in the description.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: