cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl fails to upload mutliple binary files to a CGI.pm script (RedHat, Win2k)

From: <Alexander.Farber_at_nokia.com>
Date: Tue, 9 Mar 2004 17:05:11 +0100

Hi,

I have a CGI-script which uses the CGI.pm Perl module
to provide an enctype="multipart/form-data" web form
with multiple file upload fields. This web script works
fine when used from Internet Explorer or Mozilla Firefox.

The script fails however with curl. I've tried both
Windows and Linux (RedHat 9) versions as shown below:

H:\jwalter\rom>H:\curl.exe --version
curl 7.11.0 (win32) libcurl/7.11.0 zlib/1.1.4
Protocols: ftp gopher telnet dict ldap http file
Features: libz

boclu21:rom {481} /usr/bin/curl --version curl 7.8 (i386-redhat-linux-gnu) libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)

The error message I get in the Apache's error_log is:

[Tue Mar 9 15:11:07 2004] upload-image.pl: mot2img failed: 11 at /var/www/cgi-bin/upload-image.pl line 538, <fh00003cipher.dat> line 1.

I do read from <$fhcipher> which is $query->upload('cipher')
in my Perl script but not on the line 538 (strange??)
I do try to run system('mot2img', ...) and it does work
fine with the web browsers mentioned above.

The outputs for the Windows and Linux versions of curl
are listed below. Does anyone have an idea what could
be wrong? I'm sorry, but I don't have a simple test
case right now. Is multiple HTTP-upload supposed to work?

Regards
Alex

H:\jwalter\rom>H:\curl.exe -v -F flash=@H:\WD2.IMG.OLD -F start=8000 -F end=15F0000 -F offset=70000000 -F place=9FF8 -F conf=@flash_src.conf -F cipher=@cipher.dat http://boclu21/cgi-bin/upload-image.pl
* About to connect() to boclu21 port 80
* Connected to boclu21.europe.nokia.com (172.25.90.223) port 80
> POST /cgi-bin/upload-image.pl HTTP/1.1
User-Agent: curl/7.11.0 (win32) libcurl/7.11.0 zlib/1.1.4
Host: boclu21
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 18557371
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------4be156a8f575

< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Tue, 09 Mar 2004 14:11:01 GMT
< Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
        "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>OK</title>
</head><body>
Content-type: text/html

<H1>Software error:</H1>
<PRE>mot2img failed: 11 at /var/www/cgi-bin/upload-image.pl line 538, &lt;fh00003cipher
.dat&gt; line 1.
</PRE>
<P>
For help, please send mail to the webmaster (<a href="mailto:Alexander.Farber_at_nokia.com">A
lexander.Farber_at_nokia.com</a>), giving this error message
and the time and date of the error.

* Closing connection #0

boclu21:rom {480} /usr/bin/curl -v -F flash=@/home/afarber/WD2.IMG.OLD -F start=8000 -F end=15F0000 -F offset=70000000 -F place=9FF8 -F conf=@flash_src.conf -F cipher=@cipher.dat http://boclu21/cgi-bin/upload-image.pl
* Connected to boclu21 (172.25.90.223)
> POST /cgi-bin/upload-image.pl HTTP/1.1
User-Agent: curl/7.8 (i386-redhat-linux-gnu) libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)
Host: boclu21
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 18557268
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
        "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>OK</title>
</head><body>
Content-type: text/html

<H1>Software error:</H1>
<PRE>mot2img failed: 11 at /var/www/cgi-bin/upload-image.pl line 539, &lt;fh00003cipher.dat&gt; line 1.
</PRE>
<P>
For help, please send mail to the webmaster (<a href="mailto:Alexander.Farber_at_nokia.com">Alexander.Farber_at_nokia.com</a>), giving this error message
and the time and date of the error.

* Closing live connection (#0)
Received on 2004-03-12