cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Upload Misbehaving

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 7 May 2008 12:17:53 -0700

On Wed, May 07, 2008 at 05:39:57AM -0700, von wrote:
> Thanks for the concern, all the values I sent are dummies. Here's what I got

Including your password "1America"?

> using HTTP1.0. I got a "Speed Upload" now but still no uploaded file. The
> cookie is being created in the server though.
>
> curl -o c:\temp\login.out -u username:password -T c:\temp\file2upload.log
> securedURL
> -k -b FDX securedURL/cookie.dat -0 -v

This command line looks like it got somewhat mangled. Are you trying to
PUT to two different URLs? Or are you trying to upload one file and download
another? If you're uploading two files, you need another -T argument to
provide the second file name. If you want to download the second time, you
need to run curl a second again without the -T option.

> * About to connect() to securedURL port 443 (#0)
> * Trying theIPAddress... connected
> * Connected to securedURL (theIPAddress) port 443 (#0)
> * Server auth using Basic with user 'username'
> > PUT /sqr1%2Elog HTTP/1.0
> > Authorization: Basic ZmdwX3Bzb2Z0OjFBbWVyaWNh
> > User-Agent: curl/7.18.1 (i386-pc-win32) libcurl/7.18.1 OpenSSL/0.9.8g zlib/
> 1.2
> .3
> > Host: securedURL
> > Accept: */*
> > Content-Length: 577
> >
> } [data not shown]
> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 100 577 0 0 100 577 0 795 --:--:-- --:--:-- --:--:-- 795<
> HTTP/1.1 200 OK
> Why is it still HTTP 1.1 here? Based from your comment it's still 200 OK with
> Speed Upload but no data in the server.

The server you're talking to speaks HTTP/1.1, so that's how it responds. If
you look at the PUT request above, you'll see that it's HTTP/1.0 as you
requested.

> < Date: Wed, 07 May 2008 12:28:31 GMT
> < Server: SecureTransport/4.7
> * Added cookie FDX="76506c595a66484e3653496c65365a4f4b364f447a673d3d" for
> domain
> securedURL, path /, expire 0
> < Set-Cookie: FDX=76506c595a66484e3653496c65365a4f4b364f447a673d3d; path=/;
> Secu
> re
> < Accept-Ranges: bytes
> < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> < Features: CHPWD;RTCK;STCK;ASC;DNDISP
> < Connection: close
> < Content-Type: text/plain; charset=UTF-8
> <
> { [data not shown]
> * SSLv3, TLS alert, Client hello (1):
> { [data not shown]
> 100 611 0 34 100 577 36 617 --:--:-- --:--:-- --:--:-- 0*
> Closing connection #0
> * SSLv3, TLS alert, Client hello (1):
> } [data not shown]
>
> * About to connect() to securedURL port 443 (#0)
> * Trying theIPAddress... connected
> * Connected to securedURL (theIPAddress) port 443 (#0)
> * Server auth using Basic with user 'username'
> > PUT /cookie.dat HTTP/1.0
> > Authorization: Basic ZmdwX3Bzb2Z0OjFBbWVyaWNh
> > User-Agent: curl/7.18.1 (i386-pc-win32) libcurl/7.18.1 OpenSSL/0.9.8g zlib/
> 1.2
> .3
> > Host: securedURL
> > Accept: */*
> > Cookie: FDX=76506c595a66484e3653496c65365a4f4b364f447a673d3d
> >

Once again, curl is not sending a Content-Length or Transfer-Encoding. Not
kosher, but I'm able to reproduce it now at least.

> * Empty reply from server
> * Connection #0 to host securedURL left intact
> curl: (52) Empty reply from server
> * Closing connection #0
> * SSLv3, TLS alert, Client hello (1):

The curl command-line you give above only has one -T option but two URLs.
It turns out that curl doesn't handle that correctly. The first request
is fine, but the second is missing a Content-Length or Transfer-Encoding
header. That's something that should be fixed in curl, although the
command-line that produced it is broken so we can't entirely blame curl.

It's possible that this is what's confusing the server in your case. In
any case, you need to fix the command line in one of the ways I described
at the beginning of this message.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-05-07