Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > HELP-How does Apache server passes an XML document to a CGI?

Reply
Thread Tools

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

 
 
Terry Jones
Guest
Posts: n/a
 
      03-23-2005
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.
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-23-2005


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/
 
Reply With Quote
 
 
 
 
Peter Flynn
Guest
Posts: n/a
 
      03-23-2005
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"

 
Reply With Quote
 
Nick Kew
Guest
Posts: n/a
 
      03-24-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Tomcat5.5 clustering problem with Apache HTTP server 2.2.4 tanmoy.b81 Java 0 02-04-2009 08:46 AM
Does instance_eval passes self as block argument? LAMBEAU Bernard Ruby 9 01-08-2009 05:40 PM
How To: handle DataGrid row Click Event that passes rows column values to server-side code behind function Dennis Fricker ASP .Net Datagrid Control 0 10-04-2004 04:02 PM
Refer to an XML document from within an XML document Manish Hatwalne XML 1 07-13-2004 10:24 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments