cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Beginner's help with Perl and Curl

From: Scott Medaugh <medaugh_at_bellsouth.net>
Date: Fri, 27 Apr 2007 15:55:48 -0400

When I try that approach, I still get the 500 errors, but the errors are:

[Fri Apr 27 15:49:16 2007] [error] [client 00.00.00.00 ] Premature end of
script headers: index.pl

There is no indication of what the true problem is, but the curl statement
never seems to attempt any kind of upload to the server.

Both the client side and the server side will be under my control so I don't
think I will need cgiwrap as was also suggested.

Scott

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "the curl tool" <curl-users_at_cool.haxx.se>
Sent: Thursday, April 26, 2007 9:03 AM
Subject: Re: Beginner's help with Perl and Curl

> 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.html
>
>
Received on 2007-04-27