curl-users
Re: Beginner's help with Perl and Curl
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 26 Apr 2007 15:03:58 +0200 (CEST)
Date: Thu, 26 Apr 2007 15:03:58 +0200 (CEST)
On Thu, 26 Apr 2007, Scott Medaugh wrote:
> my $query = new CGI;
>
> my $filename = $query->param("fileName");
> $filename =~ s/.*[\/\\](.*)/$1/;
> my $upload_filehandle = $query->upload("fileName");
This is really not related to curl but is simply a question of using CGI.pm
and I suppose there are much better lists/forums for that purpose.
Anyway, I have a piece of perl that receives a HTTP multipart formpost and it
lets CGI.pm receives the whole lot and just get it from a temporary file after
the request is complete:
$query = new CGI;
$filename=$query->param("upfile");
$tmpFile = $query->tmpFileName($filename);
... then $tmpfile contains the uploaded data.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2007-04-26