HELP-How does Apache server passes an XML document to a CGI?

Discussion in 'XML' started by Terry Jones, Mar 23, 2005.

  1. Terry Jones

    Terry Jones Guest

    I am trying to setup an Apache web server to accept XML document and
    use a CGI to process the content of the XML file. My questions are:

    * When a client performs a POST to the server; assume that the content
    of the post is an XML file, where does Apache place the file?
    * How do I setup Apache so that when it receives an XML file, it will
    invoke a particular CGI so that the XML file can be consumed?
    * Is there a way to configure Apache so that it does NOT use disk
    space to store the received XML file, instead, keep it in memory and
    pass it to my XML file?

    Thanks for any lead.
     
    Terry Jones, Mar 23, 2005
    #1
    1. Advertising

  2. Terry Jones wrote:

    > I am trying to setup an Apache web server to accept XML document and
    > use a CGI to process the content of the XML file. My questions are:
    >
    > * When a client performs a POST to the server; assume that the content
    > of the post is an XML file, where does Apache place the file?


    I don't think Apache places the body of an HTTP POST request anywhere,
    if you POST data to whatever.php for instance then your PHP script is
    called by Apache and it is then up to the PHP script to process the
    request body (for instance in PHP 5 by reading the stream php://input).


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 23, 2005
    #2
    1. Advertising

  3. Terry Jones

    Peter Flynn Guest

    Terry Jones wrote:

    > I am trying to setup an Apache web server to accept XML document and
    > use a CGI to process the content of the XML file. My questions are:
    >
    > * When a client performs a POST to the server; assume that the content
    > of the post is an XML file, where does Apache place the file?


    It doesn't (or rather, it may do some temporary invisible store-to-disk,
    but not anywhere you can get at it externally). What happens is that the
    file arrives as a MIME message-part in the POST. Think of it as roughly
    equivalent to an email attachment. The job of your script is to handle
    it and *then* do something with it (which may include saving to disk).

    > * How do I setup Apache so that when it receives an XML file, it will
    > invoke a particular CGI so that the XML file can be consumed?


    It's the other way round: it's your script that does the receiving in
    the first place. Google for cgi file upload to find some code.

    > * Is there a way to configure Apache so that it does NOT use disk
    > space to store the received XML file, instead, keep it in memory and
    > pass it to my XML file?


    That's in effect what it does.

    ///Peter
    --
    sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
    &;top"
     
    Peter Flynn, Mar 23, 2005
    #3
  4. Terry Jones

    Nick Kew Guest

    Peter Flynn wrote:
    > Terry Jones wrote:
    >
    >
    >>I am trying to setup an Apache web server to accept XML document and
    >>use a CGI to process the content of the XML file. My questions are:
    >>
    >>* When a client performs a POST to the server; assume that the content
    >>of the post is an XML file, where does Apache place the file?

    >
    >
    > It doesn't (or rather, it may do some temporary invisible store-to-disk,
    > but not anywhere you can get at it externally).


    Apache doesn't, unless you tell it to. But if the XML is a file upload,
    then CGI libraries typically put them in a tempfile, as CGI doesn't do
    asynchronous input. If the OP wants to avoid tempfiles, then he'll
    have to RTFM for his CGI library (and make sure file uploads are
    limited to a size he can buffer in memory without DOSing himself).

    > (snip)


    --
    Nick Kew
     
    Nick Kew, Mar 24, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Prichard
    Replies:
    0
    Views:
    788
    Tony Prichard
    Dec 12, 2003
  2. Dennis Fricker
    Replies:
    0
    Views:
    226
    Dennis Fricker
    Oct 4, 2004
  3. LAMBEAU Bernard
    Replies:
    9
    Views:
    121
    Mike Gold
    Jan 8, 2009
  4. Damon
    Replies:
    29
    Views:
    973
    krakle
    Jun 26, 2004
  5. BestFriend
    Replies:
    2
    Views:
    916
Loading...

Share This Page