Announcement

Collapse
No announcement yet.

Code samples and CGI help ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Code samples and CGI help ?

    Hi all,

    I used XPort Pro with OS Evolution. I have several questions about embedded HTTP web server :

    I added my index.html file (with FTP, under /http/config) => it's ok, my web page appears with the web navigator. But now, I want to use my CGI script (project built with "Sourcery G++" tool with MCF5208 target). So I added a new directory on target : /http/config/cgi-bin, and I upload my cgi script into. But from my web page (index.html) when the CGI script is called, a HTTP error appears (400 Bad Request: Unknown Request ).

    > What is the folders structure for the web server (for CGI scripts) ?
    > What is the best practice for the XPORT Pro for using CGI scripts ?
    > Specific HTTP server configuration ?

    Note : my CGI script writes in C.

    About code samples (http://www.lantronix.com/device-netw....html#download) : how to retrieve its ?

    Thank you very much,

    Best regards,

    Anthony

  • #2
    CGI sample code

    Pick up the SDK for the XPort-Pro http://forums.lantronix.com/showthread.php?t=595 and look at the cgi.c sample code.

    Comment


    • #3
      Hi all,

      I am New to Xport Pro, but after reading initial doc's and manuals I find that they are not very helpful in getting one started.
      This post is an example where very little info is provided and the response given to take a look at the cgi.c example doesn't really address the question.

      Can someone tell me where do I place cgi scripts for execution in the file system?

      At this stage I want to confirm whether the Xport Pro is suitable for my application - as a Web Server (Device Server) that can read data from a serial port device and serve it out in real-time (~ every one second) .
      I want to download my html pages to Xport device (via ftp) with java script files and cgi files.

      Where are these js and cgi files to be located for them to work ?
      e.g. /http directory ot whatever?

      Also I need to be able to send a rather large file (~ 30MB) located (SD card) on my serial device (not on the Xport Pro) - any suggestions on how this may be achieved?


      thanks in advanced
      cam

      Comment


      • #4
        Hello. I'm facing a same problem. Could someone tell me if it's solved or not? Thanks!

        Comment


        • #5
          I can answer some of the questions in this thread.

          1. You don't place CGI scripts in the file system, you have to build them as part of your application. They are linked into the Evolution Web Manager by the using the HttpDynamicCallbackAdd function (this is shown in the cgi.g example). The Evolution O/S also provides functions for reading and parsing the CGI parameters.

          2. Any other web page resources, e.g. javascript files, css files, images etc. are placed in the /http folder where the Evolution Web Manager will find them.

          Comment

          Working...
          X