a CGI script is started on request of the webserver. You should build an HTML page, containing a file input type (make sure the form tag contains: ENCTYPE="multipart/form-data")
and a cgi script. ready to receive a paramter (file) by what ever name you gave the file input field
So know that *duh*. I know howto write a file upload script...
But someone sends XML with a post to my cgi|pl&url script. I just want to receive the file in a stream or something like that. Not in a file just a stream like to print to STDOUT that I immediatly can use.
That must be possible without HTML page!!!
Maybe my I can't explain properly what I mean *sigh*
-- My opinions may have changed,
but not the fact that I am right
I think you are misunderstanding how CGI works. HTML is just a user interface for the web. When a user has an HTML form, the browser takes that information and creates a POST request from the form data.
You don't need an HTML form to send a post. You could generate an appropriate one yourself. One quick easy way to do it would be to have the sender code use LWP to make the POST request and use a regular CGI to process it.
Again. Who mentioned CGI. It isn't necessary in CGI. I know how LWP works to post something. I know that. I just told earlier I want to receive the XML stream posted to my https server. Can it be done just to receive the stream. I don't want that file upload thing 'cos that isn't what I need.
Let me give a rough example.Watch out! insecure script: no use strict and -wT. Only used do demonstrate my intentions...
The sending script:
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("PlanetXML/0.1 " . $ua->agent);
my $req = new HTTP::Request POST => 'http://www.test.be/cgi-bin/xmlrec
+eive.cgi';
$req->content_type('text/xml');
$content=<<END;
<request>
<header>
<from>Sender</from>
<to>Receiver</to>
</header>
<body>
lots of stuff
</body>
</request>
END
$req->content($content);
my $res = $ua->request($req);
if ($res->is_success) {
print $res->content;
} else {
print "Error\n";
}